From 87c6136f3e9a9f074e49f25994e151d4a3f4e795 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Tue, 17 Dec 2024 15:53:55 +0000 Subject: [PATCH] In lossless_to_jpeg, prevent imagemagick returning a different colourspace --- cpdfimage.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpdfimage.ml b/cpdfimage.ml index 75effde..963e7fe 100644 --- a/cpdfimage.ml +++ b/cpdfimage.ml @@ -684,7 +684,7 @@ let lossless_to_jpeg pdf ~pixel_threshold ~length_threshold ~percentage_threshol (Filename.quote_command path_to_convert ((if components = 4 then ["-depth"; "8"; "-size"; string_of_int w ^ "x" ^ string_of_int h] else []) @ [out; "-quality"; string_of_float qlossless ^ "%"] @ - (if components = 1 then ["-colorspace"; "Gray"] else if components = 4 then ["-colorspace"; "CMYK"] else []) @ + (if components = 1 then ["-colorspace"; "Gray"] else if components = 4 then ["-colorspace"; "CMYK"] else ["-type"; "truecolor"]) @ [out2])) in (*Printf.printf "%S\n" command;*) Sys.command command