Don't run jbig2 if no images

This commit is contained in:
John Whitington 2024-01-11 20:18:27 +00:00
parent d4dcdd4202
commit 68a4e31af2
1 changed files with 1 additions and 0 deletions

View File

@ -755,6 +755,7 @@ let preprocess_jbig2_lossy ~path_to_jbig2enc ~length_threshold ~pixel_threshold
in
Pdf.objiter process_obj pdf;
if length !objnum_name_pairs > 10000 then Pdfe.log "Too many jbig2 streams" else
if length !objnum_name_pairs = 0 then () else
(* Call jbig2 to generate one *.jbig2 for each, and a *.jbig2globals *)
let jbig2out = Filename.temp_file "cpdf" "jbig2" in
Printf.printf "jbig2out: %s" jbig2out;