mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Edit book: When edititng AZW3 files with no images in them, do not incorrectly display a number of binary records from the AZW3 file as 'unknown' miscellaneous files
This commit is contained in:
parent
531a8369cd
commit
6fb820e69a
@ -998,6 +998,13 @@ def do_explode(path, dest):
|
||||
mr = Mobi8Reader(mr, default_log)
|
||||
opf = os.path.abspath(mr())
|
||||
obfuscated_fonts = mr.encrypted_fonts
|
||||
# If there are no images then the azw3 input plugin dumps all
|
||||
# binary records as .unknown images, remove them
|
||||
if os.path.exists('images') and os.path.isdir('images'):
|
||||
files = os.listdir('images')
|
||||
unknown = [x for x in files if x.endswith('.unknown')]
|
||||
if len(files) == len(unknown):
|
||||
[os.remove('images/'+f) for f in files]
|
||||
try:
|
||||
os.remove('debug-raw.html')
|
||||
except:
|
||||
|
Loading…
x
Reference in New Issue
Block a user