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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 10:01:32 2024 UTC