Compare commits

..

No commits in common. "35bd4c5717027391e138da06744099646ce3c175" and "952e512afd1f4e91a6d32c910dc8793c83feab8b" have entirely different histories.

View file

@ -54,7 +54,7 @@ TEXTLESS_REGEX = re.compile('(台詞|セリフ|せりふ|テキスト|文字)((
FXLESS_REGEX = re.compile('効果音(な|無)し', re.I) FXLESS_REGEX = re.compile('効果音(な|無)し', re.I)
FRONT_COVER_REGEX = re.compile('(?<!裏)表紙(?!裏)|(?<!back[-_ ])(?<!back)cover|(?<!ura[-_ ])(?<!ura)hyou?sh?i(?![-_ ]?ura)', re.I) FRONT_COVER_REGEX = re.compile('(?<!裏)表紙(?!裏)|(?<!back[-_ ])(?<!back)cover|(?<!ura[-_ ])(?<!ura)hyou?sh?i(?![-_ ]?ura)', re.I)
BACK_COVER_REGEX = re.compile('裏表紙|hyou?sh?i[-_ ]?ura|ura[-_ ]?hyou?sh?i', re.I) BACK_COVER_REGEX = re.compile('裏表紙|hyou?sh?i[-_ ]?ura|ura[-_ ]?hyou?sh?i', re.I)
BONUS_REGEX = re.compile('設定|キャラ|特典|ポスター|bonus', re.I) BONUS_REGEX = re.compile('設定|キャラ|特典|ポスター', re.I)
EPILOGUE_REGEX = re.compile('after|後日談|おまけ', re.I) EPILOGUE_REGEX = re.compile('after|後日談|おまけ', re.I)
SPLITS = [ SPLITS = [
{ 'later': TEXTLESS_REGEX }, { 'later': TEXTLESS_REGEX },
@ -421,8 +421,6 @@ class Collator:
if len(srcs) == 0: if len(srcs) == 0:
return True return True
debug(f'Auto-collating {srcs}')
select_language = self.try_collate_select_language(srcs) select_language = self.try_collate_select_language(srcs)
if select_language is not False: if select_language is not False:
return select_language return select_language
@ -546,8 +544,6 @@ class Collator:
if len(non_images) != 0 or len(images) == 0: if len(non_images) != 0 or len(images) == 0:
return False return False
debug(f'Comparing PDF {inner_pdf} and images {images}')
pdf_sizes = pdf_image_sizes(inner_pdf) pdf_sizes = pdf_image_sizes(inner_pdf)
standalone_sizes = [standalone_image_size(f) for f in images] standalone_sizes = [standalone_image_size(f) for f in images]
@ -556,8 +552,6 @@ class Collator:
if not (median_pdf_size and median_standalone_size): if not (median_pdf_size and median_standalone_size):
return False 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: if abs(len(pdf_sizes) - len(standalone_sizes)) > 2:
with fitz.open(inner_pdf) as pdf: with fitz.open(inner_pdf) as pdf:
pdf_page_count = len(pdf) pdf_page_count = len(pdf)