Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 07-09-2012, 03:52 AM   #16
pirl8
Pest
pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.
 
Posts: 204
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, PW3
Quote:
Originally Posted by kovidgoyal View Post
Ah, that's the trick.
Yep, I don't understand why they have hidden such a nice feature that way!
pirl8 is offline   Reply With Quote
Old 07-09-2012, 03:57 AM   #17
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Now that I can get the fonts to show up on my Touch, it isn't the obfuscation. It's probably some other field in the header that the Touch requires to enable "publisher font support". Unfortunately, I am way too busy right now to go through the dance of change header fields, copy to touch, open book, curse Amazon's stupidity, rinse and repeat. So this isn't going to be fixed anytime soon.

Patches welcome.
kovidgoyal is offline   Reply With Quote
Advert
Old 07-09-2012, 09:59 AM   #18
pirl8
Pest
pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.
 
Posts: 204
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, PW3
I know nothing about those fields but if there is a way to browse and edit them - even with an hex editor - I'll be glad to try. Could you please redirect me to some info about the header structure?

Last edited by pirl8; 07-09-2012 at 11:36 AM.
pirl8 is offline   Reply With Quote
Old 07-09-2012, 12:01 PM   #19
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Use mobi2mobi and there is a wiki page that documents the MOBI header in the mobileread wiki. And of course there is the calibre source code. Look in the ebooks/mobi/*.py files.

You can dump a mobi's headers (and all records) in a nice text representation on which you can run diff by

calibre-debug --inspect-mobi filename.mobi

Compare a kindlegen mobi to a calibre mobi and see if you can spot the difference. If you find something that look suspicious either zero it out in the kindlegen mobi or change it in the calibre mobi (the latter is much harder if it involves adding fields)

But be warned, the MOBI format was designed by a bunch of monkeys on a sugar high.

Last edited by kovidgoyal; 07-09-2012 at 12:04 PM.
kovidgoyal is offline   Reply With Quote
Old 07-09-2012, 06:37 PM   #20
pirl8
Pest
pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.
 
Posts: 204
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, PW3
Quote:
Originally Posted by kovidgoyal View Post
calibre-debug --inspect-mobi filename.mobi
I build a simple book with nothing else but a content page, a font, a cover image and a stylesheet. There are many differences between KindleGen and Calibre generated file, but most are different offsets.

The most noticeable ones are the "KF8 resources (images/fonts) count (125)" EXTH header which is 0 for KindleGen and 4 for Calibre and a couple of fields which are present in the KindleGen EXTH header and absent in Calibre:
Code:
fontsignature (300): '\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb\xfd\xe9\xe6'
KF8 cover URI (129): 'kindle:embed:0001'
In the KindleGen file I've set all the payload bytes in the "fontsignature" header to "0x2A": it still displayed the font.
I've also unsuccesfully tried to manually add the header to the Calibre generated file (changed EXTH header length, file count and padding but obviously I'm missing something).

:-(
pirl8 is offline   Reply With Quote
Advert
Old 07-10-2012, 12:33 AM   #21
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 43,843
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You can easily patch the calibre source code to add field to the EXTH header. Edit the build_exth function in mobi/writer8/exth.py. Instructions for running calibre from source are here: http://manual.calibre-ebook.com/develop.html
kovidgoyal is offline   Reply With Quote
Old 07-10-2012, 06:30 PM   #22
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: 7,636
Karma: 5433388
Join Date: Nov 2009
Device: many
Hi,

Kindlegen generated mobis have two headers and two EXTH sections, not just one. Have you tried setting the fontsignature payload to 0x2a in both mobi header exth regions to see if that impacts the problem?

I don't think mobi2mobi prperly deals with both headers in kindlegen generated mobis so you will have to use a hex editor to change both. You might want to check out Mobi_Unpack to see how to find both headers.

Please let us know what you find out.

Thanks,

Kevin



Quote:
Originally Posted by pirl8 View Post
I build a simple book with nothing else but a content page, a font, a cover image and a stylesheet. There are many differences between KindleGen and Calibre generated file, but most are different offsets.

The most noticeable ones are the "KF8 resources (images/fonts) count (125)" EXTH header which is 0 for KindleGen and 4 for Calibre and a couple of fields which are present in the KindleGen EXTH header and absent in Calibre:
Code:
fontsignature (300): '\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xbb\xfd\xe9\xe6'
KF8 cover URI (129): 'kindle:embed:0001'
In the KindleGen file I've set all the payload bytes in the "fontsignature" header to "0x2A": it still displayed the font.
I've also unsuccesfully tried to manually add the header to the Calibre generated file (changed EXTH header length, file count and padding but obviously I'm missing something).

:-(
KevinH is offline   Reply With Quote
Old 07-12-2012, 07:12 AM   #23
pirl8
Pest
pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.pirl8 ought to be getting tired of karma fortunes by now.
 
Posts: 204
Karma: 239254
Join Date: Jan 2012
Location: Italy
Device: KT, PW3
Quote:
Originally Posted by KevinH View Post
Hi,

Kindlegen generated mobis have two headers and two EXTH sections, not just one. Have you tried setting the fontsignature payload to 0x2a in both mobi header exth regions to see if that impacts the problem? [...] Please let us know what you find out.
Ok. I did it.

I changed the fontsignature EXTH header via Hex editor in both locations as a sequence of '*'. Now calibre-debug -m my.azw3 reads:

Code:
fontsignature (300): '************************************************'
My Kindle Touch still recognizes embedded fonts and renders them well. Maybe the header has to be there but content is not important. Or maybe it has nothing to do with activating embedded fonts.

I will try to run Calibre from sources as Kovid suggested and add that header to see if the generated azw3 will behave differently.

I'm attaching my ePub sample if anyone else wishes to try.
Attached Files
File Type: epub p.epub (141.8 KB, 178 views)

Last edited by pirl8; 07-12-2012 at 07:33 AM.
pirl8 is offline   Reply With Quote
Old 07-12-2012, 01:18 PM   #24
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@pirl8: Try this. (Header looks patched, haven't actually put anything on my Touch to check yet).

EDIT: Killed deprecated attachments. Fix merged upstream.

Last edited by NiLuJe; 09-30-2012 at 05:17 PM.
NiLuJe is offline   Reply With Quote
Old 07-12-2012, 01:42 PM   #25
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Where can I find the ZIP file of the source code for 0.8.59?
JSWolf is offline   Reply With Quote
Old 07-12-2012, 01:51 PM   #26
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@JSWolf: http://calibre-ebook.googlecode.com/...-0.8.59.tar.xz (Among other places, it's also mirrored on SF).

The patch also applies cleanly to a bzr checkout.
NiLuJe is offline   Reply With Quote
Old 07-12-2012, 02:03 PM   #27
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by NiLuJe View Post
@JSWolf: http://calibre-ebook.googlecode.com/...-0.8.59.tar.xz (Among other places, it's also mirrored on SF).

The patch also applies cleanly to a bzr checkout.
How do I open this thing with Windows?
JSWolf is offline   Reply With Quote
Old 07-12-2012, 02:08 PM   #28
NiLuJe
BLAM!
NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.NiLuJe ought to be getting tired of karma fortunes by now.
 
NiLuJe's Avatar
 
Posts: 13,477
Karma: 26012492
Join Date: Jun 2010
Location: Paris, France
Device: Kindle 2i, 3g, 4, 5w, PW, PW2, PW5; Kobo H2O, Forma, Elipsa, Sage, C2E
@JSWolf: 7-zip should do it, albeit probably in two passes.
NiLuJe is offline   Reply With Quote
Old 07-12-2012, 02:26 PM   #29
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by NiLuJe View Post
@JSWolf: 7-zip should do it, albeit probably in two passes.
I'm going to have to leave this to someone else. Too much work to get it going. I have to find this that and the other thing to add in to even begin to figure out how to run from the source.
JSWolf is offline   Reply With Quote
Old 07-12-2012, 03:20 PM   #30
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 73,897
Karma: 128597114
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by NiLuJe View Post
@pirl8: Try this. (Header looks patched, haven't actually put anything on my Touch to check yet).
kovidgoyal could you please make a Windows build with this fix in it and I'll gladly test it out? Thanks.
JSWolf is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Questions about KF8/AZW3/Mobi8 from/to conversion pirl8 Calibre 12 09-14-2015 11:01 AM
Science Fiction Wells, H.G.: The War of the Worlds. KF8/AZW3. v1.0 2012-05-21 JSWolf Other Books 5 09-13-2012 06:43 AM
Embedding fonts JaneFancher Calibre 14 04-10-2010 09:28 PM
Embedding fonts AprilHare ePub 6 01-02-2010 11:42 AM


All times are GMT -4. The time now is 06:28 PM.


MobileRead.com is a privately owned, operated and funded community.