mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-04 04:05:38 +01:00
Fix #2066 (AttributeError: 'BookHeader' object has no attribute 'first_image_index')
This commit is contained in:
parent
04f0e389af
commit
7294199798
1 changed files with 3 additions and 1 deletions
|
|
@ -89,6 +89,8 @@ def __init__(self, raw, ident):
|
|||
self.sublanguage = 'NEUTRAL'
|
||||
self.exth_flag, self.exth = 0, None
|
||||
self.ancient = True
|
||||
self.first_image_index = -1
|
||||
self.mobi_version = 1
|
||||
else:
|
||||
self.ancient = False
|
||||
self.doctype = raw[16:20]
|
||||
|
|
@ -519,7 +521,7 @@ def extract_images(self, processed_records, output_dir):
|
|||
os.makedirs(output_dir)
|
||||
image_index = 0
|
||||
self.image_names = []
|
||||
start = self.book_header.first_image_index
|
||||
start = getattr(self.book_header, 'first_image_index', -1)
|
||||
if start > self.num_sections or start < 0:
|
||||
# BAEN PRC files have bad headers
|
||||
start=0
|
||||
|
|
|
|||
Loading…
Reference in a new issue