Jump to content

gd and imagemagick direct output just stopped working.


severndigital

Recommended Posts

As of this morning, I am unable to directly output any images from gd or imagemagick

 

if i save them, to a file the exact same code works fine.

 

when I try to display the images directly to the browser i get this error

The image “http://www.mineposter.com/testing” cannot be displayed because it contains errors.

 

I am trying to determine what has changed, but I am having difficulty figuring it out, since nothing has changed that I can tell.

 

has anyone else experienced this? and if so, what did you do to fix it?

 

again .. the exact same code works if i save the file and then display it.

Your script that is producing the image is probably outputting some characters either before or after the image data. When you have the script save the image as a file, those extra characters are not saved with the file.

 

Make sure that there are no extra characters before the first opening <?php tag or after the last closing ?> tag and that you are not echoing anything, producing any php errors, or have any closing/opening php tags that have some white-space between them.

It's likely that your php.ini settings changed or reverted to the default for either output_buffering or error_reporting/display_errors and your file that dynamically produces the image is outputting something in addition to the content-type header and the image data.

 

Comment out the content-type header statement and browse directly to the URL of your file that produces the image to see if there are any php errors being output or if you can then see any characters before or after the image data, in comparison to the image that you are having the code save to a file.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.