Change #252881
| Category | ffmpeg |
| Changed by | Leo Izen <leo.izen@gmail.com> |
| Changed at | Sat 20 Dec 2025 17:53:23 |
| Repository | https://git.ffmpeg.org/ffmpeg.git |
| Project | ffmpeg |
| Branch | master |
| Revision | 784aa09fa8222f6704d953b5035f8d0f0bec1623 |
Comments
avcodec/exif: parse additional EXIF IFDs Most EXIF metadata is in IFD0 and most EXIF payloads only contain one IFD, but it is possible for there to be more IFDs after the existing trailing one. exiftool and similar software report these IFDs as IFD1, IFD2, etc. This commit reads those additional IFDs and attaches them as dummy entries in the top-level IFD ranging from 0xFFFC down to 0xFFED, which are unused by the EXIF spec. The EXIF API is only able to return and work with a single IFD, so by attaching it as a subdirectory this metadata can be preserved. This is done transparently through the read/write process. Upon parsing an additional IFD1, it will be attached, but it will be written with av_exif_write after IFD0 rather than as a subdirectory, as intended. Existing files without more than one IFD, i.e. most files, will be unaffected by this change, as well as API clients looking to parse specific fields, but now more metadata is parsed and written, rather than simply being discarded as trailing data. Signed-off-by: Leo Izen <leo.izen@gmail.com>
Changed files
- libavcodec/exif.c
- tests/ref/fate/exif-image-jpg
- tests/ref/fate/exif-image-webp
- tests/ref/fate/mov-heic-demux-still-image-multiple-thumb