php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #73514 imagecreatefromjpeg fatal error on non-jpg file
Submitted: 2016-11-14 11:52 UTC Modified: 2016-11-14 15:43 UTC
From: hrvoje dot novosel at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: GD related
PHP Version: 7.0.13 OS: Linux / CentOS 7
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: hrvoje dot novosel at gmail dot com
New email:
PHP Version: OS:

 

 [2016-11-14 11:52 UTC] hrvoje dot novosel at gmail dot com
Description:
------------
When you try to load a GIF or PNG via imagecreatefromjpeg function you get a Fatal error instead of a warning / return false.

Probably related/same issue as
https://bugs.php.net/bug.php?id=73116

Test script:
---------------
$image = imagecreatefromjpeg('image.png');

Expected result:
----------------
warning and $image = false

Actual result:
--------------
Fatal error: imagecreatefromjpeg(): gd-jpeg: JPEG library reports unrecoverable error: Not a JPEG file: starts with ..

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-14 15:43 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2016-11-14 15:43 UTC] cmb@php.net
I can confirm that this happens with an external libgd, but not
with the bundled libgd, and that this ticket is a duplicate of bug
#73479 (which might in turn be a duplicate of bug #73116, but I'm
not sure, because I can't reproduce the reported behavior with the
bundled libgd).
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Fri Jun 25 14:01:23 2021 UTC