Skip to content

Rework JPEG parsing to handle markers properly

Compare
Choose a tag to compare
@Roughsketch Roughsketch released this 10 Aug 18:32
· 133 commits to master since this release

The previous implementation of JPEG parsing relied on tags being the first thing encountered in an image, and having metadata not get in the way. This was a poor implementation and led to issues where JPEG files with EXIF data could show up as corrupted or report an improper size.

As of 0.8.7 the JPEG parsing has been reworked to instead read each JPEG marker, determine whether it is the dimension tag, and if not skip the entire length of the tag. This prevents the library from getting stuck inside metadata sections and reading unrelated data as invalid markers.