Calibre writes 0xffffffff in "First image index" field of MOBI header (it's a field at offset 108) when
ebook-convert --mobi-file-type new is used and no images are provided in input file. Source code of this Calibre action is located at
calibre/ebooks/mobi/writer8/mobi.py.
Kindle Touch 5.3.7 displays error ("Unable to Open Item") on selecting book for reading, when result of aforementioned
ebook-convert is copied to device with
.mobi extension, but when resulting file is copied to device with
.azw3 extension, KT displays it without errors.
So, device is able to read resulting file, however, KindleUnpack v65 can't unpack it, showing following exception:
Spoiler:
Code:
Traceback (most recent call last):
File "/tmp/KindleUnpack_v65/lib/kindleunpack.py", line 1699, in <module>
sys.exit(main())
File "/tmp/KindleUnpack_v65/lib/kindleunpack.py", line 1688, in main
unpackBook(infile, outdir)
File "/tmp/KindleUnpack_v65/lib/kindleunpack.py", line 1619, in unpackBook
process_all_mobi_headers(files, sect, mhlst, K8Boundary, False)
File "/tmp/KindleUnpack_v65/lib/kindleunpack.py", line 1143, in process_all_mobi_headers
for i in xrange(beg, end):
OverflowError: Python int too large to convert to C long
Here are inputs of
ebook-convert:
Spoiler:
- converting command:
Code:
ebook-convert index.html without_images.mobi --title Without images --authors Anonymous --language en --mobi-file-type new
- input file (index.html):
Code:
<!DOCTYPE html>
<html>
<head><title>Hello world!</title></head>
<body><p>Hello world!</p></body>
</html>
- Calibre version:
Code:
$ ebook-convert --version
ebook-convert (calibre 1.25.0)
Created by: Kovid Goyal <kovid@kovidgoyal.net>
ebook-convert output is attached to this post (it's the same file but with two different extensions, just for convenience).