Skip to content

Commit af1d2a5

Browse files
committed
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.
1 parent 7e15c54 commit af1d2a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_avif.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ irot_imir_to_exif_orientation(const avifImage *image) {
5959
return axis ? 7 // 90 degrees anti-clockwise then swap left and right.
6060
: 5; // 90 degrees anti-clockwise then swap top and bottom.
6161
}
62-
return 6; // 90 degrees anti-clockwise.
62+
return 8; // 90 degrees anti-clockwise.
6363
}
6464
if (angle == 2) {
6565
if (imir) {
@@ -75,7 +75,7 @@ irot_imir_to_exif_orientation(const avifImage *image) {
7575
? 5 // 270 degrees anti-clockwise then swap left and right.
7676
: 7; // 270 degrees anti-clockwise then swap top and bottom.
7777
}
78-
return 8; // 270 degrees anti-clockwise.
78+
return 6; // 270 degrees anti-clockwise.
7979
}
8080
}
8181
if (imir) {

0 commit comments

Comments
 (0)