summaryrefslogtreecommitdiffstats
path: root/video/image_writer.c
diff options
context:
space:
mode:
authorLeo Izen <leo.izen@gmail.com>2023-01-25 12:13:28 -0500
committerLeo Izen <leo.izen@gmail.com>2023-01-31 12:39:04 -0500
commit7990dd8f3f664e01c984a405dad7c8af320cabf1 (patch)
tree0143d92cad7adff00c52d4b9ca084ef1f6110448 /video/image_writer.c
parent88918411f3533e75df0ddce2cdeb25ce55804589 (diff)
downloadmpv-7990dd8f3f664e01c984a405dad7c8af320cabf1.tar.bz2
mpv-7990dd8f3f664e01c984a405dad7c8af320cabf1.tar.xz
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.
Diffstat (limited to 'video/image_writer.c')
-rw-r--r--video/image_writer.c1
1 files changed, 1 insertions, 0 deletions
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);