You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
exif read : warnings and errors : Potentially invalid endianess, Illegal IFD size and Undefined index #9397
Hello community,
I read that on older php versions exif read function was not working properly on certain images.
I should have been patched with new php versions... But not fully...
On recent DJI images, I have a persistent uncapacity to correctly "read exif data" from image
Image example:
here an example of errors I have:
Please note that with other images, it works like a charm. And not problem for me to extract data.
Here is my code:
`//get the EXIF
$exif = exif_read_data($file, 'IFD0');
echo $exif===false ? "Aucun en-tête de donnés n'a été trouvé. \n" : "L'image contient des en-têtes \n";
$exif = exif_read_data($file);
The problem is that this image has a makernote with an uncommon (non-standard?) format which contains the DJI Info Tags. Since there is no special support for reading this, the reading fails early, and that causes quite some information to be missing from the exif_read_data() results.
I have not been able to find some normative information about this format, but the following work-around might be a start:
What PHP version are you running? (also this is probably more a php-src issue then a doc issue)
My PHP version is 8.1.0.
The problem is that this image has a makernote with an uncommon (non-standard?) format which contains the DJI Info Tags. Since there is no special support for reading this, the reading fails early, and that causes quite some information to be missing from the exif_read_data() results.
I have not been able to find some normative information about this format, but the following work-around might be a start:
Completely failing to parse other EXIF data after parsing the maker note failed, is a bug, and should be fixed (not sure how; patch above is more like a PoC). Being able to parse DJI info tags is more like a feature request, though.
Completely failing to parse other EXIF data after parsing the maker note failed, is a bug, and should be fixed (not sure how; patch above is more like a PoC). Being able to parse DJI info tags is more like a feature request, though.
I'm not sure if I'm in the right issue, but I'm seeing the "Illegal IFD size" warning when I call exif_read_data() on https://shallowsky.com/images/annular-eclipse-2012/img_5405.jpg (among other images). It doesn't fail to parse the rest of the exif, it's just an annoying warning cluttering my server logs. exiftool shows the image's EXIF without any complaints. exiftool also doesn't show anything matching "dji", "maker" or "note". I'm not sure what PHP is complaining about or how to fix it since the warning isn't specific.
@akkana That looks like a different issue (the maker note is Canon). It might be because it's a Canon model specific maker note we don't yet parse, or because of a different reason. Can you please make a new bug report for that? Thank you!
Activity
Girgias commentedon Aug 20, 2022
What PHP version are you running? (also this is probably more a php-src issue then a doc issue)
cmb69 commentedon Aug 22, 2022
Right. Transferring.
cmb69 commentedon Aug 22, 2022
The problem is that this image has a makernote with an uncommon (non-standard?) format which contains the DJI Info Tags. Since there is no special support for reading this, the reading fails early, and that causes quite some information to be missing from the
exif_read_data()results.I have not been able to find some normative information about this format, but the following work-around might be a start:
That would yield:
Ben29980 commentedon Aug 22, 2022
My PHP version is 8.1.0.
Thanks @cmb69, do you think that native php exif read function could be updated ?
Or should I use a php exiftools library ?
cmb69 commentedon Aug 22, 2022
Completely failing to parse other EXIF data after parsing the maker note failed, is a bug, and should be fixed (not sure how; patch above is more like a PoC). Being able to parse DJI info tags is more like a feature request, though.
Ben29980 commentedon Sep 19, 2022
Thanks @cmb69 , should I open a feature request ?
cmb69 commentedon Sep 19, 2022
Feel free to open a new ticket. However, someone needs to implement that. :)
akkana commentedon Apr 4, 2023
I'm not sure if I'm in the right issue, but I'm seeing the "Illegal IFD size" warning when I call exif_read_data() on https://shallowsky.com/images/annular-eclipse-2012/img_5405.jpg (among other images). It doesn't fail to parse the rest of the exif, it's just an annoying warning cluttering my server logs. exiftool shows the image's EXIF without any complaints. exiftool also doesn't show anything matching "dji", "maker" or "note". I'm not sure what PHP is complaining about or how to fix it since the warning isn't specific.
ndossche commentedon Apr 5, 2023
@akkana That looks like a different issue (the maker note is Canon). It might be because it's a Canon model specific maker note we don't yet parse, or because of a different reason. Can you please make a new bug report for that? Thank you!
akkana commentedon Apr 5, 2023
Done, issue #11020 with a small test case included. Sorry for spamming this issue.
Merge branch 'PHP-8.1' into PHP-8.2
Merge branch 'PHP-8.2'
Ben29980 commentedon Aug 10, 2023
Hello dear,
Does anyone have news about this topic ?
By trying php 8.2, I still have error :
Illegal IFD size: 2 + 0x5B61*12 = 0x4488E > 0x5C75Best
Girgias commentedon Aug 10, 2023
What patch version are you on? Because just saying PHP 8.2 is not sufficiant.
Ben29980 commentedon Aug 10, 2023
8.2.0 sorry...
Girgias commentedon Aug 10, 2023
Please update to the latest patch version
Ben29980 commentedon Aug 10, 2023
Works fine ! Good job !
Fix phpGH-9397: exif read : warnings and errors : Potentially invalid…