PHP functions containing imagick stop working after a while?

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
jordz
Posts: 1
Joined: 2011-04-10T12:01:09-07:00
Authentication code: 8675308

PHP functions containing imagick stop working after a while?

Post by jordz »

Hello all,

I've been a user of the Imagick PHP class for about 6 months now and i've implemented it in multiple Image altering functions across my project. Last week one of my functions, which simply equalizes the image using equalizeImage and then echo's the image out, stopped working. In all browsers it just returned a blank page, however when I echo'd out the image without a header('content-type: image/jpeg') it returned what looks to be the raw image. There were no errors displayed whatsoever (all my PHP errors are on) and I hadn't touched the code for the functions in weeks because it had been in use and working fine for that period of time. Since I'm using a MVC framework (cakePHP) I moved the function into another controller (another file) and tried to equalise the image again with the page returning blank. I managed to fix it eventually by moving the function into yet another file but I couldn't find the cause of the problem.

Today the same equalise function in the new file is producing this strange blank output again but to my dismay another function which echo's out a watermarked image to the page is doing the EXACT same thing (this function was working fine when the equalise function died the first time) I can't figure out whats causing the problem!

I have a variety of other functions which create thumbnails and then write them to directories on my server and these seem to work absolutely fine (for now) but when it comes to echoing out an image (not saving it anywhere) the output seems to be corrupt jpegs :(

This is simply the code for my function:

Code: Select all

$image = new Imagick($image_path);
		$image->equalizeImage();
		header('content-type: image/jpeg');
		echo $image;
		
		die(); 
What I don't understand is, these functions have been working fine for the past 2 weeks (used daily at least 50 times) and all of a sudden they just stop working? Imagick is still working on other parts of the application though.

Thanks in advance,

Jordan
ustas19
Posts: 4
Joined: 2011-10-17T09:37:32-07:00
Authentication code: 6789
Location: ne-bra-sko

Re: PHP functions containing imagick stop working after a wh

Post by ustas19 »

Did you checked your error.log?
Make movie online for free, easy&fast.
Post Reply