PHP exif_read_data Illegal IFD size

前端 未结 5 1823
面向向阳花
面向向阳花 2021-02-18 22:45

I\'m working on an application where I fix orientation (if it is present) of jpeg files downloaded from an AWS bucket.

Here you can verify that this image has exif Rotat

5条回答
  •  青春惊慌失措
    2021-02-18 23:33

    PHP 5.6.2x is having a bug with its EXIF capability (see bug #72914 as well as #72819 for further info). Attempting to read EXIF data will result in one of the described errors (Illegal IFD size, IFD bad data, other).

    At present (2016-11-21) there is no fix available for the 5.6 branch. There is some testing going on in branch 7.

    Implement a local fix by testing for the function throwing IFD errors, and when confirmed assume EXIF to be unavailable for the duration of the script.

    (You can patch that into the loader if you wish, and 'overload' the functions to return default false/0/null instead to indicate breakage)

提交回复
热议问题