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

IMagick is a native PHP extension to create and modify images using the ImageMagick API. ImageMagick Studio LLC did not write nor does it maintain the IMagick extension, however, IMagick users are welcome to discuss the extension here.
Post Reply
merovinq
Posts: 4
Joined: 2010-12-18T11:46:18-07:00
Authentication code: 8675308

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

Post 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.
Attachments
ACR-RCL100D-Remote-Controlled-Searchlight--12V-10001.gif
ACR-RCL100D-Remote-Controlled-Searchlight--12V-10001.gif (28.98 KiB) Viewed 9699 times
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
merovinq
Posts: 4
Joined: 2010-12-18T11:46:18-07:00
Authentication code: 8675308

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

Post 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.
Post Reply