mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 10:43:52 +02:00
MOBI metadata reader: Handle invalid PRC files with spurious image_offset headers
This commit is contained in:
parent
a9ffac7885
commit
491d1a8954
1 changed files with 4 additions and 1 deletions
|
|
@ -861,7 +861,10 @@ def get_metadata(stream):
|
|||
cover_index = mh.first_image_index + mh.exth.cover_offset
|
||||
data = mh.section_data(int(cover_index))
|
||||
else:
|
||||
data = mh.section_data(mh.first_image_index)
|
||||
try:
|
||||
data = mh.section_data(mh.first_image_index)
|
||||
except:
|
||||
data = ''
|
||||
buf = cStringIO.StringIO(data)
|
||||
try:
|
||||
im = PILImage.open(buf)
|
||||
|
|
|
|||
Loading…
Reference in a new issue