MONTAGE in IMAGE MAGICK
Posted: 2008-09-19T14:46:29-07:00
We are using MT 4.1 on 2.4.21-32.0.1.EL, Apache/2.0.55 (Unix) PHP/5.2.6, Image::Magick (version 6.4.1) and Perl 5.8.0.
Captcha image is not getting generated. We found that views/lib/MT/Util/Captcha.pm suddenly stops at line
my $im = $imbase->Montage(geometry => $geometry_str,
tile => $tile_geom);
Debug statements show that control does not go beyond this line.
Strange thing is that, a PNG image is generated if we execute ./mt-comments.cgi from command line after setting variables like
PATH_INFO to captcha/2/ayZZwvmHnNX2xoe4cFBuKxWTVrQlcpn6YFvAlEIZ" i.e. simulating that it is being executed by Apache as a cgi script. This time control goes beyond Montage() call.
Any clues/pointers? Please let me know if you need more configuration information.
Thanks,
Sameer
We found that gs (ghostscript) binary was not in the PATH, but still that did not resolve the issue yet.
We also wrote a minimal perl script using image magick library to create montage of 2 images. This too works from shell prompt but fails via Apache.
Most puzzling thing is that there is no single error message anywhere except that Apache says premature end of headers.
We also enabled CGI error log, but it prints nothing. As before, control does not go beyond Montage() call.
We have also printed all environment variables when script runs from Apache vs from command line and nothing is suspicious there.
Captcha image is not getting generated. We found that views/lib/MT/Util/Captcha.pm suddenly stops at line
my $im = $imbase->Montage(geometry => $geometry_str,
tile => $tile_geom);
Debug statements show that control does not go beyond this line.
Strange thing is that, a PNG image is generated if we execute ./mt-comments.cgi from command line after setting variables like
PATH_INFO to captcha/2/ayZZwvmHnNX2xoe4cFBuKxWTVrQlcpn6YFvAlEIZ" i.e. simulating that it is being executed by Apache as a cgi script. This time control goes beyond Montage() call.
Any clues/pointers? Please let me know if you need more configuration information.
Thanks,
Sameer
We found that gs (ghostscript) binary was not in the PATH, but still that did not resolve the issue yet.
We also wrote a minimal perl script using image magick library to create montage of 2 images. This too works from shell prompt but fails via Apache.
Most puzzling thing is that there is no single error message anywhere except that Apache says premature end of headers.
We also enabled CGI error log, but it prints nothing. As before, control does not go beyond Montage() call.
We have also printed all environment variables when script runs from Apache vs from command line and nothing is suspicious there.