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.22k stars 128 forks source link

Ignore EXIF orientation for HEIF/AVIF #304

Closed qbnu closed 5 months ago

qbnu commented 6 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 5 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 5 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 5 months ago

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