From: Leo Izen <leo.izen@gmail.com>
To: ffmpeg-devel@ffmpeg.org
Subject: Re: [FFmpeg-devel] [PATCH 3/3] avcodec/pngenc: write eXIf chunks
Date: Thu, 15 Feb 2024 03:19:00 -0500
Message-ID: <df705df9-ddaa-47b5-804c-7a8833fbc0cf@gmail.com> (raw)
In-Reply-To: <AS8P250MB0744752ECCB13E63CBC3BCBE8F4E2@AS8P250MB0744.EURP250.PROD.OUTLOOK.COM>
[-- Attachment #1.1.1: Type: text/plain, Size: 1754 bytes --]
On 2/14/24 13:53, Andreas Rheinhardt wrote:
> Leo Izen:
>> Write EXIF metadata exposed AV_FRAME_DATA_EXIF as an eXIf chunk
>> to PNG files, if present.
>>
>> Signed-off-by: Leo Izen <leo.izen@gmail.com>
>> ---
>> libavcodec/pngenc.c | 4 ++++
>> 1 file changed, 4 insertions(+)
>>
>> diff --git a/libavcodec/pngenc.c b/libavcodec/pngenc.c
>> index 50689cb50c..a302c879da 100644
>> --- a/libavcodec/pngenc.c
>> +++ b/libavcodec/pngenc.c
>> @@ -413,6 +413,10 @@ static int encode_headers(AVCodecContext *avctx, const AVFrame *pict)
>> }
>> }
>>
>> + side_data = av_frame_get_side_data(pict, AV_FRAME_DATA_EXIF);
>> + if (side_data)
>> + png_write_chunk(&s->bytestream, MKTAG('e', 'X', 'I', 'f'), side_data->data, FFMIN(side_data->size, INT_MAX));
>> +
>> side_data = av_frame_get_side_data(pict, AV_FRAME_DATA_ICC_PROFILE);
>> if ((ret = png_write_iccp(s, side_data)))
>> return ret;
>
> If I see this correctly, then these patches can lead to a situation
> where an input packet has rotation metadata in exif which gets exported
> twice -- as displaymatrix and as exif metadata side data. If the user
> changes the displaymatrix (e.g. applies the transformation to the image
> data and removes the displaymatrix side data before reencoding), the
> exif data (that the user would probably not be aware of) would still be
> there and get propagated into the output, corrupting it.
>
Hm. This is true, but it's also currently how the mjpeg decoder
functions (i.e. it attaches displaymatrix side data).
There are no encoders that currently save EXIF metadata, so there's no
precedent.
How do you suggest this be reconciled?
- Leo Izen (Traneptora)
[-- Attachment #1.2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
[-- Attachment #2: Type: text/plain, Size: 251 bytes --]
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
prev parent reply other threads:[~2024-02-15 8:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 21:24 [FFmpeg-devel] [PATCH 0/3] [RFC] EXIF overhaul Leo Izen
2024-02-13 21:24 ` [FFmpeg-devel] [PATCH 1/3] various: change EXIF metadata into AVFrameSideData Leo Izen
2024-02-13 21:24 ` [FFmpeg-devel] [PATCH 2/3] avcodec/pngdec: parse eXIf chunk Leo Izen
2024-02-13 21:24 ` [FFmpeg-devel] [PATCH 3/3] avcodec/pngenc: write eXIf chunks Leo Izen
2024-02-14 18:38 ` Michael Niedermayer
2024-02-14 18:53 ` Andreas Rheinhardt
2024-02-15 8:19 ` Leo Izen [this message]
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=df705df9-ddaa-47b5-804c-7a8833fbc0cf@gmail.com \
--to=leo.izen@gmail.com \
--cc=ffmpeg-devel@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