Issue
I'm using php gd library to generate image/jpeg.
I'm getting the error message:
image xyz.php cannot be displayed because it contains errors
How can I get the specific error?
Solution
- If you want to log the errors in image files (binary files), you shouldn't just print them, but instead - log them to external file.
When you are outputting the image to browser, there should be no output before and neither ater.
Comment out the line where you print image (imagejpeg()
), and there should be no output. If there is, you have a problem.
Side note: And make sure you are not doing the mistake of outputing the image into the HTML document directly. You have to make separate PHP file for image, and then link it into document like this:
<img src="image.php" alt="" />
Answered By - Rok Kralj Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.