View Single Post
Old 02-09-2013, 01:23 PM   #133
Ephemerality
Connoisseur
Ephemerality ought to be getting tired of karma fortunes by now.Ephemerality ought to be getting tired of karma fortunes by now.Ephemerality ought to be getting tired of karma fortunes by now.Ephemerality ought to be getting tired of karma fortunes by now.Ephemerality ought to be getting tired of karma fortunes by now.Ephemerality ought to be getting tired of karma fortunes by now.Ephemerality ought to be getting tired of karma fortunes by now.Ephemerality ought to be getting tired of karma fortunes by now.Ephemerality ought to be getting tired of karma fortunes by now.Ephemerality ought to be getting tired of karma fortunes by now.Ephemerality ought to be getting tired of karma fortunes by now.
 
Posts: 90
Karma: 610727
Join Date: Feb 2013
Device: PW1
Quote:
Originally Posted by Kamel Ezzine View Post
The effort and attention on this project are huge by the dev and highly appreciated by those who read the thread up til here!
The Calibre plugin seems to be more stable, but what about the "loc issue"
(x-ray not implementing loc positions and pages), any improvement on that point?
Theoretically, having an amazon x-ray file AND a generated x-ray file of the same ebook would help to figure out the "differences" and find out where the "loc implementation" is, then duplicating the code!
I apologize for my generalist terms, since I'm not a connoisseur.
So, anyone to help with the loc position issue?
That being the last step before having a Perfect amazon-like x-ray!
I've actually been working quite a bit over the past week on creating an x-ray builder that generates all of the loc and chapter information by unpacking the mobi file and running through the raw book content (the page-by-page info is calculated on the Kindle itself).
The format is fairly simple, each loc points to a point in the book and defines the excerpts you see on that character's page. The locations are positions within the raw html file (I've been unpacking the mobis with mobi_unpack using the -r flag to get the raw markup). The default loc that the X-Ray builder here gives is [100,100,100,6], so say that is [A,B,C,D].
A is the start position of the excerpt.
B is is the length of the excerpt.
C is the position within the excerpt that starts being bolded.
D is the length of the bolded section.

Chapters are basically the same. For example, the last part of the .asc file:
"chapters":[{"name":"Chapter 1","start":1020,"end":6423},{"name":"Chapter 2","start":6423,"end":11294}],"srl":1020,"erl":11294}
Same thing, just the starting and ending positions in the file. The only trick here is that srl and erl have to be there as well to have the chapters show up; srl being the start of chapters and erl being the end of course. With those defined, plus the locs for each character, you also get to see the "progress bar" that the Amazon X-Rays have.

Quote:
Originally Posted by kaswistry View Post
I see. Well, I made these using the X-ray plugin on Calibre. Just entered the Shelfari address and the Wikipedia address and "created the X-ray file". These are X-ray files for "Steve Jobs" and "The Hypnotist".
I took a look at the files, the Hypnotist one is definitely just the Wikipedia info, I took a look at Shelfari and there's actually no info for it (http://www.shelfari.com/books/326144...notist-A-Novel), so you'd have to modify the entry first. The Steve Jobs one seemed fine to me, but I plugged the asin and guid from a different book into it and tried it out, it gave the same error as you are getting. Now I can't get my own X-Ray files to work on that same book which was working before! So I have no idea what's going on there.
I would definitely try the site and a totally different book instead just to see if it makes a difference, I haven't even used the Calibre plugin so I don't know how well it works...

Edit: I did notice a code at the bottom of the error page which might help a bit as well.
SX = X-Ray file not valid
VS/VN/VO = Version number is anything but "1"
WA = Issue with ASIN
WG = Issue with GUID

Edit #2: I hadn't thought about it, but since the Calibre version already has access to the book it could definitely be modified to add the locs. My version is a separate program done in C# so it's not nearly as convenient...

Last edited by Ephemerality; 02-09-2013 at 04:49 PM.
Ephemerality is offline   Reply With Quote