diff --git a/dlibrary/dlibrary.py b/dlibrary/dlibrary.py index 2ef7d32..46da923 100755 --- a/dlibrary/dlibrary.py +++ b/dlibrary/dlibrary.py @@ -421,6 +421,8 @@ class Collator: if len(srcs) == 0: return True + debug(f'Auto-collating {srcs}') + select_language = self.try_collate_select_language(srcs) if select_language is not False: return select_language @@ -544,6 +546,8 @@ class Collator: if len(non_images) != 0 or len(images) == 0: return False + debug(f'Comparing PDF {inner_pdf} and images {images}') + pdf_sizes = pdf_image_sizes(inner_pdf) standalone_sizes = [standalone_image_size(f) for f in images] @@ -552,6 +556,8 @@ class Collator: if not (median_pdf_size and median_standalone_size): return False + debug(f'PDF: {len(pdf_sizes)} images, {median_pdf_size}; standalone: {len(standalone_sizes)} images, median {median_standalone_size}') + if abs(len(pdf_sizes) - len(standalone_sizes)) > 2: with fitz.open(inner_pdf) as pdf: pdf_page_count = len(pdf)