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.
This commit is contained in:
Leo Izen 2023-01-25 12:13:28 -05:00
parent e4e3a8fc0b
commit c98e73534c
1 changed files with 1 additions and 0 deletions

View File

@ -355,6 +355,7 @@ static struct mp_image *convert_image(struct mp_image *image, int destfmt,
.h = d_h, .h = d_h,
.p_w = 1, .p_w = 1,
.p_h = 1, .p_h = 1,
.color = image->params.color,
}; };
mp_image_params_guess_csp(&p); mp_image_params_guess_csp(&p);