View Single Post
Old 07-12-2014, 08:46 AM   #900
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,898
Karma: 6120478
Join Date: Nov 2009
Device: many
Hi,

My bet is that that EXTH was set to 0xffffffff which is often used as a placeholder for missing values in MobiHeaders. The size field of the EXTH value must be corrupt or broken. I would rather detect that during EXTH parsing and leave the code as is.

Please try running a recent version of DumpMobiHeader_v016 or later on the problem ebook so check the field size and the unsigned hex value.

Thanks,

KevinH

Quote:
Originally Posted by tkeo View Post
Hi,

In the Calibre KindleUnpack Plugin thread, an error is reported.
https://www.mobileread.com/forums/sho...&postcount=215
https://www.mobileread.com/forums/sho...&postcount=225


In my guees, the cause of the error is that CoverOffset EXTH value is the out of range of int. I think It is possible to be fixed by replacing,

Code:
i = int(metadata['CoverOffset'][0])
if imgnames[i] is not None:
to
Code:
i = int(metadata['CoverOffset'][0])
if i >= 0 and i < len(imgnames) and imgnames[i] is not None:
and
Code:
imageNumber = int(metadata['CoverOffset'][0])
cover_image = self.imgnames[imageNumber]
to
Code:
imageNumber = int(metadata['CoverOffset'][0])
if imageNumber >= 0 and self.imageNumber < len(self.imgnames):
    cover_image = imgnames[imageNumber]
Reported versions are v0.67 and v0.72.1(core version v.72a); however, perhaps the latest version have same codes.
I will post fixed test version to the Calibre Plugin thread to see it work or not.

I am no idea why CoverOffset EXTH has such a value. Is is needed to be fixed in the latest version?

Thanks,
KevinH is online now   Reply With Quote