Correctly crop embedded thumbs for Canon JPEGs

Authored by tommo on May 23 2019, 6:48 PM.

Description

Correctly crop embedded thumbs for Canon JPEGs

Summary:
JPEGs created by Canon Cameras have an embedded thumbnail. However only a certain area of the thumb is "valid", i.e. there are black bars on top and bottom. This change moves the thumbnail extraction logic to JpegContent and correctly crops the thumb by reading the Canon specific exif tag. The same black bars can be observed in thumbnails by Sony and Nikon. They however don't seem to provide such an exif tag, AFAIK.

Also suggests to let the thumbnailgenerator use the embedded thumbnail even if applyExifOrientation() is disabled. I don't see how the original image and its embedded thumb can be rotated differently, i.e. effectively being two different images. The only purpose of applyExifOrientation() should be to apply any rotation/transformation consistently to both, the original and its thumb, and not preventing to use the embedded thumb at all.

Reviewers: Gwenview, ngraham

Reviewed By: Gwenview, ngraham

Subscribers: ngraham, Gwenview

Tags: Gwenview

Differential Revision: https://phabricator.kde.org/D21329

Details

Committed
ngrahamMay 23 2019, 7:03 PM
Reviewer
Gwenview
Differential Revision
D21329: Correctly crop embedded thumbs for Canon JPEGs
Parents
R260:5ff416f16db2: Remove orphaned member
Branches
Unknown
Tags
Unknown