php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #32633 Warning message from imagecreatefromjpeg not suppressed when using @
Submitted: 2005-04-08 10:42 UTC Modified: 2005-04-08 11:33 UTC
From: anders at apt dot no Assigned:
Status: Not a bug Package: GD related
PHP Version: 4.3.11 OS: Windows 2003 Advanced Server
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: anders at apt dot no
New email:
PHP Version: OS:

 

 [2005-04-08 10:42 UTC] anders at apt dot no
Description:
------------
I'm trying import a JPEG image (http://kunde.apt.no/aso/imagecreatefromjpeg/demo.jpg) to a resource using imagecreatefromjpeg. This function fails and even though I use @ infront of the function, it still generates an error warning 'Corrupt JPEG data: 203 extraneous bytes before marker 0xd9'. The image works fine in every other program I've tested it with.

Some guy has found his own workaround:
http://www-personal.umd.umich.edu/~dennismv/corruptjpeg.html


Reproduce code:
---------------
if ($im = @imagecreatefromjpeg('http://kunde.apt.no/aso/imagecreatefromjpeg/demo.jpg')) {
	echo 'Valid JPEG file';
	imagedestroy($im);
} else {
	echo 'Not a valid JPEG file';
}

Expected result:
----------------
I expect the code to output 'Not a valid JPEG file', since the JPEG contains errors, and nothing else (since I've suppressed error messages with the @)

Actual result:
--------------
Not a valid JPEG fileCorrupt JPEG data: 203 extraneous bytes before marker 0xd9

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-04-08 11:31 UTC] derick@php.net
It *is* a broken image - the GIMP says so too.
 [2005-04-08 11:33 UTC] derick@php.net
And that other guy says it's a message from libjpeg - which we do not control. Which makes it not a bug in PHP -> bogus.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 06:01:34 2025 UTC