cropImage fail / internal server error
Posted: 2012-12-20T10:42:01-07:00
Have been troubleshooting a Hostpapa account which fails when Wordpress 3.5 attempts to crop media uploads to create thumbnails. I dug into wordpress code and reproduced the problem outside of Wordpress, as follows:
Doing a queryFormats call causes cropImage to fail. Either with just a blank screen, or internal server error or a memory error if the file is large. Leaving it out will work, even on large images.
< ? php
/* This line below will cause the cropImage to fail */
Imagick::queryFormats( 'JPG');
$img = new Imagick('leonids.jpg');
$img->writeImage('testresult16.jpg');
$img->cropImage(150,150,0,0);
$img->writeImage('testresult16-crop.jpg');
? >
Any thoughts appreciated.
Version is ImageMagick 6.4.8 2011-02-03 Q16
Doing a queryFormats call causes cropImage to fail. Either with just a blank screen, or internal server error or a memory error if the file is large. Leaving it out will work, even on large images.
< ? php
/* This line below will cause the cropImage to fail */
Imagick::queryFormats( 'JPG');
$img = new Imagick('leonids.jpg');
$img->writeImage('testresult16.jpg');
$img->cropImage(150,150,0,0);
$img->writeImage('testresult16-crop.jpg');
? >
Any thoughts appreciated.
Version is ImageMagick 6.4.8 2011-02-03 Q16