sylikc / jpegview

Fork of JPEGView by David Kleiner - fast and highly configurable viewer/editor for JPEG, BMP, PNG, WEBP, TGA, GIF and TIFF images with a minimal GUI. Basic on-the-fly image processing is provided - allowing adjusting typical parameters as sharpness, color balance, rotation, perspective, contrast and local under-/overexposure.
Other
2.07k stars 123 forks source link

Ignore EXIF orientation for HEIF/AVIF #304

Closed qbnu closed 3 months ago

qbnu commented 4 months ago

EXIF orientation should be ignored according to JXL and HEIF specs.

Sources:
libjxl
https://github.com/strukturag/libheif/issues/227#issuecomment-916176774
https://github.com/AOMediaCodec/libavif/issues/996#issuecomment-1196157817
https://zpl.fi/exif-orientation-in-different-formats/

While testing this I found 2 issues:

  1. We don't support mirroring with the Orientation tag (see 0x112). Relevant code
  2. libheif automatically rotates images based on the irot and imir boxes, but libavif doesn't. example image (fixed by #305)

Fixes #299

kiawizard commented 3 months ago

@sylikc Hi Kevin! Please consider merging this one, as it is now impossible to compare jpeg/heic photos in one folder - AutoRotateEXIF=true makes heic orientation wrong, and AutoRotateEXIF=false makes jpeg orientation wrong

sylikc commented 3 months ago

I'm going to merge all these next week. I haven't had time to really look at the code but I trust qbnu's work

sylikc commented 3 months ago

I'll create an issue to track the mirror support, just so it's documented. thanks!