$image->writeImage('name/of/image') freezing on one image...
Posted: 2011-01-23T07:20:28-07:00
Ok I have a loop that resizes various images into medium and large versions of that image. It seems everything works fine until I go to write a particular image out to the server...(just this one image in the loop, others seem to be working fine.) On this particular image the file is created, but contains zero data, I need to find why the writeImage function is freezing and not writing. At least find a work around know that this write is not working and try something else. Below is a section of my code. Above this code I check for the correct mimetype before running it through the resize section of the code.
An attachment of the image in question can be found below.
Code: Select all
if(isset($this->websiteConfigs['transferProductImage'.$resize.'Width'])){
$fp = new Imagick($imagePath.$image);
$fp->resizeImage($this->websiteConfigs['transferProductImage'.$resize.'Width'], $this->websiteConfigs['transferProductImage'.$resize.'Width'], Imagick::FILTER_LANCZOS,1, true);
$fileName = $this->createKey(40);
$fp->writeImage('/path/to/write/image/tmp/'.$fileName); # gets stuck here with one image...
$fp = fopen('/path/to/write/image/tmp/'.$fileName, 'r');
} else {
$fp = fopen($imagePath.$image, 'r');
}