Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
From: James Almer via ffmpeg-devel <ffmpeg-devel@ffmpeg.org>
To: ffmpeg-devel@ffmpeg.org
Cc: James Almer <code@ffmpeg.org>
Subject: [FFmpeg-devel] [PATCH] tests/fate/image: add Exif rotation metadata tests (PR #20522)
Date: Mon, 15 Sep 2025 03:25:31 -0000
Message-ID: <175790673167.25.6607747604708272676@463a07221176> (raw)

PR #20522 opened by James Almer (jamrial)
URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20522
Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20522.patch


>From f0e1180c15e63711ad9a8a0237cf8918af906a40 Mon Sep 17 00:00:00 2001
From: James Almer <jamrial@gmail.com>
Date: Mon, 15 Sep 2025 00:21:39 -0300
Subject: [PATCH] tests/fate/image: add Exif rotation metadata tests

Signed-off-by: James Almer <jamrial@gmail.com>
---
 tests/fate/image.mak                      |  5 ++
 tests/ref/fate/jpg-exif-autorotate        | 54 +++++++++++++++++++
 tests/ref/fate/jpg-exif-noautorotate      | 63 +++++++++++++++++++++++
 tests/ref/fate/jpg-exif-rotation-override | 54 +++++++++++++++++++
 4 files changed, 176 insertions(+)
 create mode 100644 tests/ref/fate/jpg-exif-autorotate
 create mode 100644 tests/ref/fate/jpg-exif-noautorotate
 create mode 100644 tests/ref/fate/jpg-exif-rotation-override

diff --git a/tests/fate/image.mak b/tests/fate/image.mak
index 98c4e0fdcc..0f5fc17b32 100644
--- a/tests/fate/image.mak
+++ b/tests/fate/image.mak
@@ -360,6 +360,11 @@ fate-jpg-rgb-5: CMD = framecrc -idct simple -i $(TARGET_SAMPLES)/jpg/jpg-8930-5.
 FATE_JPG_TRANSCODE-$(call TRANSCODE, MJPEG, MJPEG IMAGE_JPEG_PIPE, IMAGE_PNG_PIPE_DEMUXER PNG_DECODER SCALE_FILTER) += fate-jpg-icc
 fate-jpg-icc: CMD = transcode png_pipe $(TARGET_SAMPLES)/png1/lena-int_rgb24.png mjpeg "-vf scale" "" "-show_frames"
 
+FATE_JPG_TRANSCODE-$(call TRANSCODE, PNG, IMAGE2 IMAGE_JPEG_PIPE, IMAGE_PNG_PIPE_DEMUXER MJPEG_DECODER SCALE_FILTER) += fate-jpg-exif-autorotate fate-jpg-exif-noautorotate fate-jpg-exif-rotation-override
+fate-jpg-exif-autorotate: CMD = transcode jpeg_pipe $(TARGET_SAMPLES)/jpg/Landscape_5.jpg image2 "-c png -vf scale" "" "-show_frames"
+fate-jpg-exif-noautorotate: CMD = transcode jpeg_pipe $(TARGET_SAMPLES)/jpg/Landscape_5.jpg image2 "-c png -vf scale" "" "-show_frames" "" "" "-noautorotate"
+fate-jpg-exif-rotation-override: CMD = transcode jpeg_pipe $(TARGET_SAMPLES)/jpg/Landscape_5.jpg image2 "-c png -vf scale" "" "-show_frames" "" "" "-noautorotate -display_rotation 0"
+
 FATE_JPG-$(call FRAMECRC, IMAGE2, MJPEG) += $(FATE_JPG)
 FATE_IMAGE_FRAMECRC += $(FATE_JPG-yes)
 FATE_IMAGE_TRANSCODE += $(FATE_JPG_TRANSCODE-yes)
diff --git a/tests/ref/fate/jpg-exif-autorotate b/tests/ref/fate/jpg-exif-autorotate
new file mode 100644
index 0000000000..91de8949d2
--- /dev/null
+++ b/tests/ref/fate/jpg-exif-autorotate
@@ -0,0 +1,54 @@
+517f90af06d95a6cb9c8dc893438ff0b *tests/data/fate/jpg-exif-autorotate.image2
+3023217 tests/data/fate/jpg-exif-autorotate.image2
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 1800x1200
+#sar 0: 1/1
+0,          0,          0,        1,  6480000, 0xf6940c8a
+[FRAME]
+media_type=video
+stream_index=0
+key_frame=1
+pts=0
+pts_time=0.000000
+pkt_dts=0
+pkt_dts_time=0.000000
+best_effort_timestamp=0
+best_effort_timestamp_time=0.000000
+duration=1
+duration_time=0.040000
+pkt_pos=0
+pkt_size=3023217
+width=1800
+height=1200
+crop_top=0
+crop_bottom=0
+crop_left=0
+crop_right=0
+pix_fmt=rgb24
+sample_aspect_ratio=1:1
+pict_type=I
+interlaced_frame=0
+top_field_first=0
+lossless=0
+repeat_pict=0
+color_range=pc
+color_space=gbr
+color_primaries=unknown
+color_transfer=unknown
+chroma_location=unspecified
+alpha_mode=unspecified
+TAG:XResolution=     72:1      
+TAG:YResolution=     72:1      
+TAG:ResolutionUnit=      2
+TAG:YCbCrPositioning=      1
+TAG:ImageWidth=   1800
+TAG:ImageLength=   1200
+TAG:ExifIFD/PixelXDimension=   1800
+TAG:ExifIFD/PixelYDimension=   1200
+[SIDE_DATA]
+side_data_type=EXIF metadata
+size=144
+[/SIDE_DATA]
+[/FRAME]
diff --git a/tests/ref/fate/jpg-exif-noautorotate b/tests/ref/fate/jpg-exif-noautorotate
new file mode 100644
index 0000000000..9e42787087
--- /dev/null
+++ b/tests/ref/fate/jpg-exif-noautorotate
@@ -0,0 +1,63 @@
+ee9121d8445061f3cc8ecd3bc2e7fc91 *tests/data/fate/jpg-exif-noautorotate.image2
+3025593 tests/data/fate/jpg-exif-noautorotate.image2
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 1200x1800
+#sar 0: 1/1
+0,          0,          0,        1,  6480000, 0x224eb436
+[FRAME]
+media_type=video
+stream_index=0
+key_frame=1
+pts=0
+pts_time=0.000000
+pkt_dts=0
+pkt_dts_time=0.000000
+best_effort_timestamp=0
+best_effort_timestamp_time=0.000000
+duration=1
+duration_time=0.040000
+pkt_pos=0
+pkt_size=3025593
+width=1200
+height=1800
+crop_top=0
+crop_bottom=0
+crop_left=0
+crop_right=0
+pix_fmt=rgb24
+sample_aspect_ratio=1:1
+pict_type=I
+interlaced_frame=0
+top_field_first=0
+lossless=0
+repeat_pict=0
+color_range=pc
+color_space=gbr
+color_primaries=unknown
+color_transfer=unknown
+chroma_location=unspecified
+alpha_mode=unspecified
+TAG:XResolution=     72:1      
+TAG:YResolution=     72:1      
+TAG:ResolutionUnit=      2
+TAG:YCbCrPositioning=      1
+TAG:ImageWidth=   1200
+TAG:ImageLength=   1800
+TAG:ExifIFD/PixelXDimension=   1200
+TAG:ExifIFD/PixelYDimension=   1800
+[SIDE_DATA]
+side_data_type=3x3 displaymatrix
+displaymatrix=
+00000000:  -2147483648 -2147483648           0
+00000001:  -2147483648 -2147483648           0
+00000002:            0           0  1073741824
+
+rotation=135
+[/SIDE_DATA]
+[SIDE_DATA]
+side_data_type=EXIF metadata
+size=144
+[/SIDE_DATA]
+[/FRAME]
diff --git a/tests/ref/fate/jpg-exif-rotation-override b/tests/ref/fate/jpg-exif-rotation-override
new file mode 100644
index 0000000000..0cf06fd886
--- /dev/null
+++ b/tests/ref/fate/jpg-exif-rotation-override
@@ -0,0 +1,54 @@
+051b476ac88ede4ff01f62cdcf115b5a *tests/data/fate/jpg-exif-rotation-override.image2
+3025581 tests/data/fate/jpg-exif-rotation-override.image2
+#tb 0: 1/25
+#media_type 0: video
+#codec_id 0: rawvideo
+#dimensions 0: 1200x1800
+#sar 0: 1/1
+0,          0,          0,        1,  6480000, 0x4d310f16
+[FRAME]
+media_type=video
+stream_index=0
+key_frame=1
+pts=0
+pts_time=0.000000
+pkt_dts=0
+pkt_dts_time=0.000000
+best_effort_timestamp=0
+best_effort_timestamp_time=0.000000
+duration=1
+duration_time=0.040000
+pkt_pos=0
+pkt_size=3025581
+width=1200
+height=1800
+crop_top=0
+crop_bottom=0
+crop_left=0
+crop_right=0
+pix_fmt=rgb24
+sample_aspect_ratio=1:1
+pict_type=I
+interlaced_frame=0
+top_field_first=0
+lossless=0
+repeat_pict=0
+color_range=pc
+color_space=gbr
+color_primaries=unknown
+color_transfer=unknown
+chroma_location=unspecified
+alpha_mode=unspecified
+TAG:XResolution=     72:1      
+TAG:YResolution=     72:1      
+TAG:ResolutionUnit=      2
+TAG:YCbCrPositioning=      1
+TAG:ImageWidth=   1200
+TAG:ImageLength=   1800
+TAG:ExifIFD/PixelXDimension=   1200
+TAG:ExifIFD/PixelYDimension=   1800
+[SIDE_DATA]
+side_data_type=EXIF metadata
+size=144
+[/SIDE_DATA]
+[/FRAME]
-- 
2.49.1

_______________________________________________
ffmpeg-devel mailing list -- ffmpeg-devel@ffmpeg.org
To unsubscribe send an email to ffmpeg-devel-leave@ffmpeg.org

                 reply	other threads:[~2025-09-15  3:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=175790673167.25.6607747604708272676@463a07221176 \
    --to=ffmpeg-devel@ffmpeg.org \
    --cc=code@ffmpeg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git