Image::Magick and FCGI not the best of bed partners
Here's the scenario: I wanted to be able to produce tumbnail images on the fly so that a user could upload their photos to a site and then in their page templates use a cgi call as the img src, passing the desired width and height as arguments to the script. For example:
Anyway, the problem appears to be that the FCGI module ties STDOUT to itself, whilst Image::Magick appears to want to do the same. Conflict ensues and when you call the Image::Magick Write method, your image is written to your Apache error log. Bugger. The solution then would appear to be to untie STDOUT from FCGI and tie it to Image::Magick. So that's what I'm going to do, soon. Watch this space...
Update: see my more recent post on this subject with a happy solution
<img src="/cgi-bin/image.fcgi?name=photo1.jpg&width=100&height=150"; alt="" />Not rocket science, is it, and it works fine as a normal CGI, but I wanted to run it under FastCGI for obvious reasons: It's a low volume site, so I can afford the overhead of generating thumbnails on the fly, but the speed savings from using FastCGI would be appreciated.
Anyway, the problem appears to be that the FCGI module ties STDOUT to itself, whilst Image::Magick appears to want to do the same. Conflict ensues and when you call the Image::Magick Write method, your image is written to your Apache error log. Bugger. The solution then would appear to be to untie STDOUT from FCGI and tie it to Image::Magick. So that's what I'm going to do, soon. Watch this space...
Update: see my more recent post on this subject with a happy solution
0 TrackBacks
Listed below are links to blogs that reference this entry: Image::Magick and FCGI not the best of bed partners.
TrackBack URL for this entry: http://www.robbiebow.co.uk/mt/mt-tb.cgi/13

Leave a comment