This commit is contained in:
John Whitington 2020-12-11 17:22:59 +00:00
parent f4a3260373
commit f25f4f9882
1 changed files with 1 additions and 3 deletions

View File

@ -2790,8 +2790,6 @@ let write_stream name stream =
done; done;
close_out fh close_out fh
(* FIXME: File and command quoting check on unix, windows inc command.exe *)
(* FIXME: Document it *)
let write_image pdf resources name image = let write_image pdf resources name image =
match Pdfimage.get_image_24bpp pdf resources image with match Pdfimage.get_image_24bpp pdf resources image with
| Pdfimage.JPEG (stream, _) -> write_stream (name ^ ".jpg") stream | Pdfimage.JPEG (stream, _) -> write_stream (name ^ ".jpg") stream
@ -2807,7 +2805,7 @@ let write_image pdf resources name image =
"" -> Printf.eprintf "Neither pnm2png nor imagemagick found. Specify with -p2p or -im\n" "" -> Printf.eprintf "Neither pnm2png nor imagemagick found. Specify with -p2p or -im\n"
| _ -> | _ ->
begin match begin match
Sys.command (args.path_to_im ^ " " ^ name ^ ".pnm" ^ " " ^ name ^ ".png") Sys.command (args.path_to_im ^ " " ^ "\"" ^ name ^ ".pnm\"" ^ " " ^ "\"" ^ name ^ ".png\"")
with with
0 -> Sys.remove (name ^ ".pnm"); 0 -> Sys.remove (name ^ ".pnm");
| _ -> | _ ->