Skip to content

exif_read_data warns about Illegal IFD size on some images #11020

Open
@akkana

Description

@akkana

Description

(Split off from my comment in issue #9397)

The following code:

<?php
exif_read_data("img_5405.jpg", 0, true);
?>

Resulted in this output:

[php:warn] [pid 949] [client 127.0.0.1:36226] PHP Warning:  exif_read_data(img_5405.jpg): Illegal IFD size in /home/akkana/web/tmp/exif-ifdsize/index.php on line 20

But I expected this output instead: (no warning).

A live test is available at: https://shallowsky.com/tmp/exif-ifdsize/
and the code it's using (index.php) can be downloaded here: https://shallowsky.com/tmp/exif-ifdsize/index.php.txt
The image: http://localhost/tmp/exif-ifdsize/img_5405.jpg
and I've also attached the files here:
img_5405
index.php.txt

I see this both on my local machine (PHP 8.2 from Debian sid) and on my web server (PHP 7.3 on Debian 10 buster).

exiftool doesn't seem to have any complaints about the image's exif.

PHP Version

PHP 8.2

Operating System

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions