mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-04-07 10:54:14 +03:00
fix: conversion of AVIF image rotation property to EXIF orientation
This implements a fix for the issue identified in AOMediaCodec/libavif#2727 and fixed in AOMediaCodec/libavif#2729. The code to convert irot and imir properties to EXIF orientation when decoding AVIF images in Pillow was repurposed from libavif, so it suffers the same bug.
This commit is contained in:
parent
7e15c54cad
commit
af1d2a51b3
|
@ -59,7 +59,7 @@ irot_imir_to_exif_orientation(const avifImage *image) {
|
|||
return axis ? 7 // 90 degrees anti-clockwise then swap left and right.
|
||||
: 5; // 90 degrees anti-clockwise then swap top and bottom.
|
||||
}
|
||||
return 6; // 90 degrees anti-clockwise.
|
||||
return 8; // 90 degrees anti-clockwise.
|
||||
}
|
||||
if (angle == 2) {
|
||||
if (imir) {
|
||||
|
@ -75,7 +75,7 @@ irot_imir_to_exif_orientation(const avifImage *image) {
|
|||
? 5 // 270 degrees anti-clockwise then swap left and right.
|
||||
: 7; // 270 degrees anti-clockwise then swap top and bottom.
|
||||
}
|
||||
return 8; // 270 degrees anti-clockwise.
|
||||
return 6; // 270 degrees anti-clockwise.
|
||||
}
|
||||
}
|
||||
if (imir) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user