From 68a4e31af21ed74db8b44b77c44088b2a3c7e4cc Mon Sep 17 00:00:00 2001 From: John Whitington Date: Thu, 11 Jan 2024 20:18:27 +0000 Subject: [PATCH] Don't run jbig2 if no images --- cpdfimage.ml | 1 + 1 file changed, 1 insertion(+) diff --git a/cpdfimage.ml b/cpdfimage.ml index 0299a41..82013f2 100644 --- a/cpdfimage.ml +++ b/cpdfimage.ml @@ -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;