Bug #78083 [Opn->Ver]: exif_read_data() corrupt EXIF header: maximum directory nesting level reached

From: Date: Fri, 24 Jul 2020 09:02:00 +0000
Subject: Bug #78083 [Opn->Ver]: exif_read_data() corrupt EXIF header: maximum directory nesting level reached
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-228205@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78083&edit=1

 ID:                 78083
 Updated by:         cmb@php.net
 Reported by:        fermin at ares dot uy
 Summary:            exif_read_data() corrupt EXIF header: maximum
                     directory nesting level reached
-Status:             Open
+Status:             Verified
 Type:               Bug
 Package:            EXIF related
-Operating System:   Windows 10
+Operating System:   *
 PHP Version:        7.3.5
 Block user comment: N
 Private report:     N

 New Comment:

Indeed, that appears to be a bug – exiftool processes the image
just fine.


Previous Comments:
------------------------------------------------------------------------
[2019-05-29 16:53:39] fermin at ares dot uy

Description:
------------
When using the function "exif_read_data()" on certain jpg images it outputs this warning:

"Warning: exif_read_data(php7D62.tmp): corrupt EXIF header: maximum directory nesting level
reached in \path\to\index.php on line 4"

And the metadata field 'title' does not show up on the resulting array.

You can download a problematic image for testing here https://ares.uy/P1110193.JPG

Test script:
---------------
<?php
if (!empty($_FILES)) {
  $imagen = $_FILES['imagen']['tmp_name'];
  $metadata = exif_read_data($imagen, 0, true);
  highlight_string("<?php\n\$metadata =\n" . var_export($metadata, true) .
";\n?>");
}
?>

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title>EXIF TEST</title>
  </head>
  <body>
    <form action="/" method="post"
enctype="multipart/form-data">
      <input type="file" name="imagen" value="">
      <input type="submit" name="" value="Print EXIF">
    </form>
  </body>
</html>


Expected result:
----------------
No warning message and the complete list of metadata fields on the array outputted by the function
exif_read_data.

Actual result:
--------------
Warning message and incomplete metadata array.


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



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


Thread (8 messages)

« previous php.bugs (#228205) next »