From c98e73534c85f11f067848c8703cddab00c28775 Mon Sep 17 00:00:00 2001 From: Leo Izen Date: Wed, 25 Jan 2023 12:13:28 -0500 Subject: [PATCH] video/image_writer: avoid stripping colorspace info when writing image Writing an image either with vo_image or with a screenshot will strip the colorspace info because it allocates a new mp_image that contains the same data as the old image after calling mp_image_params_guess_csp. However, mp_image_params_guess_csp cannot always guess the appropriate colorspace, so it picks a "sane default." Since this function also changes parameters so the space always makes sense, this extra info isn't harmful and allows screenshots and vo_image outs to be properly tagged with the correct colorspace. Fixes #10988. --- video/image_writer.c | 1 + 1 file changed, 1 insertion(+) diff --git a/video/image_writer.c b/video/image_writer.c index a818bae9de..85d359bba6 100644 --- a/video/image_writer.c +++ b/video/image_writer.c @@ -355,6 +355,7 @@ static struct mp_image *convert_image(struct mp_image *image, int destfmt, .h = d_h, .p_w = 1, .p_h = 1, + .color = image->params.color, }; mp_image_params_guess_csp(&p);