Bug #29878 [Com]: ImageCreateFromJpeg returns 'not a valid jpeg file'

From: Date: Fri, 01 Oct 2021 13:22:12 +0000
Subject: Bug #29878 [Com]: ImageCreateFromJpeg returns 'not a valid jpeg file'
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-236960@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=29878&edit=1

 ID:                 29878
 Comment by:         meave390 at gmail dot com
 Reported by:        cyleriggs at kc dot rr dot com
 Summary:            ImageCreateFromJpeg returns 'not a valid jpeg file'
 Status:             Closed
 Type:               Bug
 Package:            GD related
 Operating System:   Linux 2.6.8.1
 PHP Version:        5.0.1
 Assigned To:        pajoye
 Block user comment: N
 Private report:     N

 New Comment:

So glad for share me it site here https://wordunscrambler.online and look all use full way
for word puzzle game


Previous Comments:
------------------------------------------------------------------------
[2006-02-05 17:09:24] pajoye@php.net

This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

You can now allow the jpeg decoder to be more tolerant/weak:

error_reporting(E_ALL);
// 0 is the current behavior
ini_set('gd.jpeg_ignore_warning', 1);
$im = imagecreatefromjpeg($file);

Php 5.1.3+ will contain the fix.

------------------------------------------------------------------------
[2004-10-12 17:23:26] paul at gslip dot com

Has anyone at php verified that the images are corrupt? In what way are they corrupt?
Here's what I know: 
1- These images were supported with no issues whatsoever before I 'upgraded' to php 5.x

2- Every other piece of software I own, including Windows Image Viewer, Photoshop, Paint, IE,
Netscape, Imagemagick, etc. open the files with no complaint.

3- A visual inspection of the files on the byte level show nothing out of the ordinary.

That all leads me to believe that the images are not corrupt and that PHP or GD has a bug.

Please, stop being so stubborn and at least look at the problem. I can show you hundreds of examples
of where this is happening on the web. Just do a google search for 'is not a valid JPEG file
in' to see for yourselves how many sites are having this issue.

I suspect there's some new twist on the JPEG format that new digital cameras are using ,or
something along those lines, that GD and PHP just aren't yet up to speed with.

Let's get this solved folks.

------------------------------------------------------------------------
[2004-10-07 09:12:21] derick@php.net

Corrupted files are invalid, and may crash an application if attempted to use. That's why we
will not implement that. (Actually, it's not a PHP issue either, it has to do with how libgd
handles opening files).

------------------------------------------------------------------------
[2004-10-07 03:18:23] cyleriggs at kc dot rr dot com

Okay, so how about a feature suggestion than, i think that there should be the option in GD that
allows you to try and open images that have a few corrupted bytes. If other programs can open them
just fine what would be the harm in allowing programmers to choose to live with the corruptions?

------------------------------------------------------------------------
[2004-10-05 09:33:47] derick@php.net

PHP only reads non-coprrupted files - there is no bug here.

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=29878


--
Edit this bug report at https://bugs.php.net/bug.php?id=29878&edit=1


Thread (10 messages)

« previous php.bugs (#236960) next »