The branch, master has been updated
       via  74e61981b5fe7c08b398dd59b8570e87e53ceb2e (commit)
      from  742474bc24e677a507d591d6bc07da83fd7b5d73 (commit)


- Log -----------------------------------------------------------------
commit 74e61981b5fe7c08b398dd59b8570e87e53ceb2e
Author:     Leo Izen <[email protected]>
AuthorDate: Fri Sep 5 11:44:41 2025 -0400
Commit:     Leo Izen <[email protected]>
CommitDate: Sat Sep 6 13:15:24 2025 -0400

    avcodec/decode: treat orientation 1 as valid displaymatrix
    
    Since 9dc79241d9680fc050376bb0cc37875a41d00cc9 we now always pop the
    orientation off of the IFD and use a display matrix instead. This means
    we should not produce a warning and refuse if the orientation field
    indicates a default orientation (i.e. 1).
    
    Signed-off-by: Leo Izen <[email protected]>
    Reported-by: Ramiro Polla <[email protected]>

diff --git a/libavcodec/decode.c b/libavcodec/decode.c
index f395948d60..ae86e270df 100644
--- a/libavcodec/decode.c
+++ b/libavcodec/decode.c
@@ -2337,7 +2337,7 @@ static int attach_displaymatrix(AVCodecContext *avctx, 
AVFrame *frame, int orien
     int32_t *matrix;
     int ret;
     /* invalid orientation */
-    if (orientation < 2 || orientation > 8)
+    if (orientation < 1 || orientation > 8)
         return AVERROR_INVALIDDATA;
     ret = ff_frame_new_side_data(avctx, frame, AV_FRAME_DATA_DISPLAYMATRIX, 
sizeof(int32_t) * 9, &sd);
     if (ret < 0) {
diff --git a/tests/ref/fate/exif-image-jpg b/tests/ref/fate/exif-image-jpg
index 25f3b228ff..84136a9f85 100644
--- a/tests/ref/fate/exif-image-jpg
+++ b/tests/ref/fate/exif-image-jpg
@@ -34,7 +34,6 @@ alpha_mode=unspecified
 TAG:ImageDescription=                               
 TAG:Make=Canon
 TAG:Model=Canon PowerShot SX200 IS
-TAG:Orientation=      1
 TAG:XResolution=    180:1      
 TAG:YResolution=    180:1      
 TAG:ResolutionUnit=      2
@@ -199,7 +198,16 @@ TAG:ExifIFD/WhiteBalance=      0
 TAG:ExifIFD/DigitalZoomRatio=   4000:4000   
 TAG:ExifIFD/SceneCaptureType=      0
 [SIDE_DATA]
+side_data_type=3x3 displaymatrix
+displaymatrix=
+00000000:        65536           0           0
+00000001:            0       65536           0
+00000002:            0           0  1073741824
+
+rotation=0
+[/SIDE_DATA]
+[SIDE_DATA]
 side_data_type=EXIF metadata
-size=3297
+size=3285
 [/SIDE_DATA]
 [/FRAME]
diff --git a/tests/ref/fate/exif-image-tiff b/tests/ref/fate/exif-image-tiff
index f6314190b2..eebbd4f2e6 100644
--- a/tests/ref/fate/exif-image-tiff
+++ b/tests/ref/fate/exif-image-tiff
@@ -43,7 +43,6 @@ TAG:0x010A=      1
 TAG:0x010D=image_small.tiff
 TAG:StripOffsets=      8,    7808,   15608,   23408,   31208,   39008,   
46808,   54608
   62408
-TAG:Orientation=      1
 TAG:SamplesPerPixel=      3
 TAG:RowsPerStrip=     13
 TAG:StripByteCounts=   7800,    7800,    7800,    7800,    7800,    7800,    
7800,    7800
@@ -54,7 +53,16 @@ TAG:PlanarConfiguration=      1
 TAG:ResolutionUnit=      3
 TAG:Software=ImageMagick 6.5.8-0 2010-02-09 Q16 http://www.imagemagick.org
 [SIDE_DATA]
+side_data_type=3x3 displaymatrix
+displaymatrix=
+00000000:        65536           0           0
+00000001:            0       65536           0
+00000002:            0           0  1073741824
+
+rotation=0
+[/SIDE_DATA]
+[SIDE_DATA]
 side_data_type=EXIF metadata
-size=403
+size=391
 [/SIDE_DATA]
 [/FRAME]
diff --git a/tests/ref/fate/exif-image-webp b/tests/ref/fate/exif-image-webp
index 0f96254aa1..7b695bc923 100644
--- a/tests/ref/fate/exif-image-webp
+++ b/tests/ref/fate/exif-image-webp
@@ -34,7 +34,6 @@ alpha_mode=unspecified
 TAG:ImageDescription=                               
 TAG:Make=Canon
 TAG:Model=Canon PowerShot SX200 IS
-TAG:Orientation=      1
 TAG:XResolution=    180:1      
 TAG:YResolution=    180:1      
 TAG:ResolutionUnit=      2
@@ -199,7 +198,16 @@ TAG:ExifIFD/WhiteBalance=      0
 TAG:ExifIFD/DigitalZoomRatio=   4000:4000   
 TAG:ExifIFD/SceneCaptureType=      0
 [SIDE_DATA]
+side_data_type=3x3 displaymatrix
+displaymatrix=
+00000000:        65536           0           0
+00000001:            0       65536           0
+00000002:            0           0  1073741824
+
+rotation=0
+[/SIDE_DATA]
+[SIDE_DATA]
 side_data_type=EXIF metadata
-size=9718
+size=3285
 [/SIDE_DATA]
 [/FRAME]

-----------------------------------------------------------------------

Summary of changes:
 libavcodec/decode.c            |  2 +-
 tests/ref/fate/exif-image-jpg  | 12 ++++++++++--
 tests/ref/fate/exif-image-tiff | 12 ++++++++++--
 tests/ref/fate/exif-image-webp | 12 ++++++++++--
 4 files changed, 31 insertions(+), 7 deletions(-)


hooks/post-receive
-- 

_______________________________________________
ffmpeg-cvslog mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to