Fix a couple issues with CBZ files (#1529)

* Set cbz resolution to None, None when it can't be determined

* Don't consider the `__MACOSX` directory for cbz
This commit is contained in:
Paul Friederichsen 2024-03-16 15:20:09 -05:00 committed by GitHub
parent 832b90569c
commit 31211945d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 9 additions and 1 deletions

View File

@ -45,6 +45,10 @@ def GetCoverPagePath( zip_handle: zipfile.ZipFile ):
for path in all_file_paths: for path in all_file_paths:
if path.startswith('__MACOSX/'):
continue
if '.' in path: if '.' in path:
ext_with_dot = '.' + path.split( '.' )[-1] ext_with_dot = '.' + path.split( '.' )[-1]
@ -161,6 +165,10 @@ def ZipLooksLikeCBZ( path_to_zip ):
filename = zip_info.filename filename = zip_info.filename
if filename.startswith('__MACOSX/'):
continue
if '/' in filename: if '/' in filename:
directory_path = '/'.join( filename.split( '/' )[:-1] ) directory_path = '/'.join( filename.split( '/' )[:-1] )

View File

@ -484,7 +484,7 @@ def GetFileInfo( path, mime = None, ok_to_look_for_hydrus_updates = False ):
except: except:
( width, height ) = ( 100, 100 ) ( width, height ) = ( None, None )
finally: finally: