View Single Post
Old 05-11-2014, 08:27 PM   #725
eureka
but forgot what it's like
eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.eureka ought to be getting tired of karma fortunes by now.
 
Posts: 741
Karma: 2345678
Join Date: Dec 2011
Location: north (by northwest)
Device: Kindle Touch
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).
Attached Files
File Type: mobi without_images.mobi (10.2 KB, 201 views)
File Type: azw3 without_images.azw3 (10.2 KB, 181 views)
eureka is offline   Reply With Quote