Page 1 of 1

$image->writeImage('name/of/image') freezing on one image...

Posted: 2011-01-23T07:20:28-07:00
by merovinq
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.

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');
       }

An attachment of the image in question can be found below.

Re: $image->writeImage('name/of/image') freezing on one imag

Posted: 2011-01-23T08:19:08-07:00
by magick
We tried your script with the image and it wrote to disk without complaint. We're using ImageMagick 6.6.7-2, the lastest release.

Re: $image->writeImage('name/of/image') freezing on one imag

Posted: 2011-01-23T08:46:28-07:00
by merovinq
Hmm, that is weird, I am currently resizing the rest of the images, it'll take a few hours because it is quite a few and is transferring each image to another server via ftp. After it is done, I'll see what is up with that one image and let everyone know what I find.