Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Formats > Kindle Formats

Notices

Reply
 
Thread Tools Search this Thread
Old 09-16-2011, 02:29 PM   #211
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,839
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Ah, you want to only allow editing of the content, not the TOC...then yes, decompiling the NCX from the INDX records is fine.
kovidgoyal is offline   Reply With Quote
Old 09-16-2011, 03:29 PM   #212
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by fandrieu View Post
Absolutely, btw does anyone knows a way to spot calibre-generated books / identify the book generator ?
The EXTH value 204 (creator software) is set by the official tools (kindlegen, mobigen, mobipocket creator) with distinct values, but unfortunately the latest calibre versions also set this value, pretending to be a kindlegen.

I asked Kovid to remove that "feature", but he refused to do so.

So the only way to find out if a mobi files was created by calibre or not is to search the contributor EXTH (value 108) for the string "calibre".

Ciao,
Steffen
siebert is offline   Reply With Quote
Advert
Old 09-17-2011, 02:05 AM   #213
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,545
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Hey fandrieu,

I can't find where it's happening for the life of me, but something in your code is doubling the html output. It doesn't happen with books that have no ncx, but if it does have ncx data, the html file being produced is the original html x 2: as in the whole book and then the whole book all over again.

Maybe you'll have better luck spotting it.
DiapDealer is offline   Reply With Quote
Old 09-17-2011, 10:09 AM   #214
fandrieu
Member
fandrieu began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Sep 2011
Device: kindle 3
@kovid: thanks very much for your great app !

@sieberd: thanks for the info, i'll look into it.

Quote:
Originally Posted by DiapDealer View Post
I can't find where it's happening for the life of me, but something in your code is doubling the html output.
I found a file to debug that
Here's a fixed version including the typos mentioned earlier.

...

The bug was a weird collateral of the "ncx filepos anchor injection" code.
The duplication occured because an entry had -1 as filepos, meaning an extra large "dataList".

The cause was IDXT parsing, some files have an extra null entry at the end.

I added two checks to prevent both problems.

...

REUP: after posting that i realized it'd be better to use header['count'] to determine when to stop parsing IDXT...
Attached Files
File Type: zip mobiunpack_ncx_yetanother.zip (16.9 KB, 349 views)

Last edited by fandrieu; 09-17-2011 at 11:10 AM.
fandrieu is offline   Reply With Quote
Old 10-17-2011, 07:31 PM   #215
kaizoku
Junior Member
kaizoku began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Sep 2011
Device: Mac
I am getting these errors with mobi:

Unpacking Book...
Mobipocket version 6
Warning: Unknown metadata with id 405 found
Warning: Unknown metadata with id 406 found
Warning: Unknown metadata with id 407 found
Warning: Unknown metadata with id 403 found
Write ncx
Palmdoc compression
Unpack raw html
Decode images
Find link anchors
Insert data into html
Insert hrefs into html
Remove empty anchors from html
Insert image references into html
Write html
Write opf
Completed

But no dat was created just ncx opf and html
kaizoku is offline   Reply With Quote
Advert
Old 10-18-2011, 03:34 AM   #216
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,492
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by kaizoku View Post
I am getting these errors with mobi:

Unpacking Book...
Mobipocket version 6
Warning: Unknown metadata with id 405 found
Warning: Unknown metadata with id 406 found
Warning: Unknown metadata with id 407 found
Warning: Unknown metadata with id 403 found

[snip]

But no dat was created just ncx opf and html
Those aren't errors, just warnings. The data in those EXTH sections will be in the opf inside some comments, as far as I remember.
pdurrant is offline   Reply With Quote
Old 10-24-2011, 06:16 PM   #217
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
While the tool works great with regular books, it seems to have problems with some dictionaries. When I unpacked my simple Swedish-English dictionary, which I uploaded some time ago, I noticed that the <DictionaryInLanguage> value was not correctly recovered. My original .opf file contained the following entries:

<DictionaryInLanguage>sv</DictionaryInLanguage>
<DictionaryOutLanguage>en-us</DictionaryOutLanguage>

However, the reverse engineered .opf file contained the following entries:

<DictionaryInLanguage>en</DictionaryInLanguage>
<DictionaryOutLanguage>en-us</DictionaryOutLanguage>

Since the <DictionaryInLanguage> value is used by the Kindle for automatic dictionary selection, a wrong value will cause problems.

I also got a lot of "Delete operation of inflection rule failed" error messages, but I remember having read somewhere that there are still problems with inflections.
Doitsu is offline   Reply With Quote
Old 10-25-2011, 02:57 AM   #218
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,492
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by Doitsu View Post
While the tool works great with regular books, it seems to have problems with some dictionaries. When I unpacked my simple Swedish-English dictionary, which I uploaded some time ago, I noticed that the <DictionaryInLanguage> value was not correctly recovered. My original .opf file contained the following entries:

<DictionaryInLanguage>sv</DictionaryInLanguage>
<DictionaryOutLanguage>en-us</DictionaryOutLanguage>

However, the reverse engineered .opf file contained the following entries:

<DictionaryInLanguage>en</DictionaryInLanguage>
<DictionaryOutLanguage>en-us</DictionaryOutLanguage>

Since the <DictionaryInLanguage> value is used by the Kindle for automatic dictionary selection, a wrong value will cause problems.

I also got a lot of "Delete operation of inflection rule failed" error messages, but I remember having read somewhere that there are still problems with inflections.
Thanks for the bug report. Hopefully the guys working on the dictionary support can fix it up.
pdurrant is offline   Reply With Quote
Old 10-27-2011, 05:46 AM   #219
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,492
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by pdurrant View Post
Thanks for the bug report. Hopefully the guys working on the dictionary support can fix it up.
Well, actually I took a quick look, and added a language entry to fix that problem. There's still some work to me done on decoding the inflection rules. I'm sure that "Error: Delete operation of inflection rule failed" needs to be fixed. Perhaps someone with the source to a dictionary with infections could have a go?

Anyway, I've uploaded version 0.32 to the fifth post in this thread. It includes some refactoring by DiapDealer, which will hopefully make maintenance easier.
pdurrant is offline   Reply With Quote
Old 10-27-2011, 06:01 AM   #220
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by pdurrant View Post
There's still some work to me done on decoding the inflection rules. I'm sure that "Error: Delete operation of inflection rule failed" needs to be fixed. Perhaps someone with the source to a dictionary with infections could have a go?
The delete rule contains the letter which should be deleted. The error is given if that letter doesn't match the current letter of the word at the position where the deletion should be performed.

Normally this shouldn't happen, but for non-ascii letters the letters don't match. I assume that the text encodings of the rules and the actual text are different. But I have no idea what encoding is used in the rules.

I could provide the source of a minimal dictionary which shows the error if needed.

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 10-27-2011, 07:00 AM   #221
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,492
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by siebert View Post
I could provide the source of a minimal dictionary which shows the error if needed.
If you could do that (source and compiled dictionary, if possible), I'll take a look. Thanks.
pdurrant is offline   Reply With Quote
Old 10-27-2011, 05:36 PM   #222
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Ok, here is the promised sample dictionary. The first entry creates the error.

deleteruleerror.zip

Ciao,
Steffen
siebert is offline   Reply With Quote
Old 10-28-2011, 08:08 AM   #223
pdurrant
The Grand Mouse 高貴的老鼠
pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.pdurrant ought to be getting tired of karma fortunes by now.
 
pdurrant's Avatar
 
Posts: 71,492
Karma: 306214458
Join Date: Jul 2007
Location: Norfolk, England
Device: Kindle Voyage
Quote:
Originally Posted by siebert View Post
Ok, here is the promised sample dictionary. The first entry creates the error.
In one of the places in the sample dictionary, the german double-s ß is stored at 0x0573 instead of as 0xDF (the Windows Latin-1 encoding for ß).

A quick hack at the right place to substitute 0xDF back in for 0x0573 fixes things for this instance.

Unfortunately, I don't really understand why the error is happening, and it isn't a general fix — there are still problems with the swedish dictionary mentioned above.

Perhaps with access to the source for the swedish dictionary, it might be possible to work out what's going on.
pdurrant is offline   Reply With Quote
Old 10-29-2011, 06:59 AM   #224
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by pdurrant View Post
Perhaps with access to the source for the swedish dictionary, it might be possible to work out what's going on.
I did some tests and found out that the script seems to stumble over inflection entries with both a hyphen and an umlaut in them. For example:

Code:
<idx:infl><idx:iform value="abc-böckers"/></idx:infl>
Please find attached a small sample of the Swedish dictionary whose first entry will cause 4 Error: Delete operation of inflection rule failed messages when the .prc file is unpacked.

Unfortunately, there seem to be other serious issues with accented characters which you'll see when you look at the original and the reconstructed .html files.

Even though the reconstructed dictionary looks the same as the original when it's compiled, it no longer works as a dictionary.
Attached Files
File Type: zip sven.zip (1.1 KB, 252 views)
Doitsu is offline   Reply With Quote
Old 10-29-2011, 07:14 AM   #225
siebert
Developer
siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.siebert has a complete set of Star Wars action figures.
 
Posts: 155
Karma: 280
Join Date: Nov 2010
Device: Kindle 3 (Keyboard) 3G / iPad 9 WiFi / Google Pixel 6a (Android)
Quote:
Originally Posted by Doitsu View Post
Even though the reconstructed dictionary looks the same as the original when it's compiled, it no longer works as a dictionary.
What exactly do you mean with "no longer works as a dictionary"?

In mobipocket reader, a dictionary uses javascript to implement dictionary search. This might indeed not work.

My focus was to use the recompiled dictionary in the kindle app (as the formatting of my originial dictionary made it unsuitable for the popup dictionary window), which should work as the kindle app only uses the dicitionary index and doesn't support javascript (so I removed the javascript code before recompiling the dictionary).

Ciao,
Steffen

Last edited by siebert; 10-29-2011 at 07:20 AM.
siebert is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can i rotate text and insert images in Mobi and EPUB? JanGLi Kindle Formats 5 02-02-2013 04:16 PM
PDF to Mobi with text and images pocketsprocket Kindle Formats 7 05-21-2012 07:06 AM
Mobi files - images DWC Introduce Yourself 5 07-06-2011 01:43 AM
pdf to mobi... creating images rather than text Dumhed Calibre 5 11-06-2010 12:08 PM
Transfer of images on text files anirudh215 PDF 2 06-22-2009 09:28 AM


All times are GMT -4. The time now is 05:22 PM.


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