This a request for comments, not yet ready diff.
I'm suggesting to remove the ancient JpegContent class and replace it with some Exiv2Content or MetadataContent class (currently called Exiv2ImageLoader).
I don't see any reason to give JPEGs that special low-level treatment as implemented by the JpegContent class. Also, the JpegContent class partly is a wrapper for Exif metadata. Instead, having a general wrapper class for Exif metadata would be nice. IMO, this would help to address bugs like 324597 and 139735.
Exif data is not specific to JPEGs only. Instead, it is available for many formats, even RAWs. An instance of Exiv2Content (similar to current handling of JpegContent) would always be created when Exif metadata is available.
With this change in mind, I'm also looking forward to a performance-related improvement: Images that provide Exif would, for instance, be able to immediately display the embedded thumbnail preview, before then going on to do the slow decoding of the full, potentially huge high-resolution image.
I've been working on this for quite a few months now and not really making progress anymore. Hoping for feedback and help here.
Open TODOs: The unit tests currently fail. I need some help here.