From: jianhuaw via ffmpeg-devel <ffmpeg-devel@ffmpeg.org> To: ffmpeg-devel@ffmpeg.org Cc: jianhuaw <code@ffmpeg.org> Subject: [FFmpeg-devel] [PATCH] avcodec/tiffenc: support writing ICC profiles (PR #20493) Date: Thu, 11 Sep 2025 14:16:33 -0000 Message-ID: <175760019437.25.13295619495070950963@463a07221176> (raw) PR #20493 opened by jianhuaw URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20493 Patch URL: https://code.ffmpeg.org/FFmpeg/FFmpeg/pulls/20493.patch The tiff reads the icc profile to the side data but doesn't write the icc profile from side data to the TIFF_ICC_PROFILE. Signed-off-by: Wu Jianhua <toqsxw@outlook.com> >From 1754d0f56d2e7ff2ec62b77c80850bc14385bfa8 Mon Sep 17 00:00:00 2001 From: Wu Jianhua <toqsxw@outlook.com> Date: Thu, 11 Sep 2025 22:12:08 +0800 Subject: [PATCH] avcodec/tiffenc: support writing ICC profiles Signed-off-by: Wu Jianhua <toqsxw@outlook.com> --- libavcodec/tiffenc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libavcodec/tiffenc.c b/libavcodec/tiffenc.c index 9a5291c257..917ff9ac1d 100644 --- a/libavcodec/tiffenc.c +++ b/libavcodec/tiffenc.c @@ -250,6 +250,7 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(avctx->pix_fmt); TiffEncoderContext *s = avctx->priv_data; const AVFrame *const p = pict; + AVFrameSideData *side_data; int i; uint8_t *ptr; uint8_t *offset; @@ -504,6 +505,11 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, ADD_ENTRY1(s, TIFF_YCBCR_POSITIONING, AV_TIFF_SHORT, 2); ADD_ENTRY(s, TIFF_REFERENCE_BW, AV_TIFF_RATIONAL, 6, refbw); } + + side_data = av_frame_get_side_data(pict, AV_FRAME_DATA_ICC_PROFILE); + if (side_data) + ADD_ENTRY(s, TIFF_ICC_PROFILE, AV_TIFF_STRING, side_data->size, side_data->data); + // write offset to dir bytestream_put_le32(&offset, ptr - pkt->data); @@ -575,7 +581,7 @@ const FFCodec ff_tiff_encoder = { .p.type = AVMEDIA_TYPE_VIDEO, .p.id = AV_CODEC_ID_TIFF, .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | - AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, + AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE | FF_CODEC_CAP_ICC_PROFILES, .priv_data_size = sizeof(TiffEncoderContext), .init = encode_init, .close = encode_close, -- 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-11 14:16 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=175760019437.25.13295619495070950963@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