Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.