Hi,
The key is that they can not be "arbitrary". They can not just use the same images and fonts ... they must use them the same in the exact same order.
For example, one way to approach this might be to:
1. adjust your input and use the latest kindlegen to create the best mobi7 but possibly a poor kf8 part, call this dual file best7.mobi
2. readjust your input and use the latest kindlegen to create a possibly sub-par mobi7 part and the best kf8 part, call this dual file best8.mobi
3. Then invoke some new python script (call it merge78.py) as follows:
python ./merge78.py best7.mobi best8.mobi bestboth.mobi
This as yet uncreated merge78.py program would
1. use the code in mobi_split.py (part of mobi_unpack.py) to split out each mobi into its two pieces
2. verify by walking through the specific images and font sections in each and using md5sums that all of these embedded resource files are in the exact same order and are identical (byte for byte).
3. if not, exit with error message that resource files and orders are not exact matches and so no merge is possible
4. otherwise take the first part of best7.mobi and the second part of best8.mobi and create one bestboth.mobi
A merge78.py python script that does this could be created with some work. The issue is that if you have to run kindlegen twice with related but slightly different input (and with differences that do not mess up the store order), and then finally put them together.
Is that something you are looking for?
And if so wouldn't it be better to simply use the current mobi_unpack.py to split best7.mobi and best8.mobi and simply save the right standalone pieces and sell or use those two separate instead of trying to merge them back into one dual mobi. Then you could use completely different images, fonts, css, etc and produce two different but each better ebooks.
KevinH
Quote:
Originally Posted by PeterHatch
So the methods I used relied on :after, which apparently works on the Previewer but not on the Fire.
So I, at least, would still like a tool to combine arbitrary mobi7 and mobi8 files; if the images and fonts need to match, that's okay.
For now I'll just use the crazy hack I found.
|