View Single Post
Old 07-02-2011, 10:40 AM   #67
Mr. X
Connoisseur
Mr. X is on a distinguished road
 
Posts: 68
Karma: 64
Join Date: Mar 2010
Location: Philadelphia
Device: iRex DR800SG
Quote:
Originally Posted by Mackx View Post
As you indicated I implemented something like it in dr1000-hackx (although that version is not yet published) it reads .drinfo files that contains metadata and a reference to an image. The current implementation is mainly to see how it can be done, my next step was indeed to link it with Calibre.
@Mr. X.: can you point me to some documents about the format of the .metadata and .cover files from Calibre?
They don't exist currently. For the nook color it resizes the image and saves it as the same name as the book but with .jpg instead of .epub/.pdf. It includes an embedded ImageMagick library so resizing to the small and medium dimensions and converting to png (I think that's what were in the SQL blobs?) are possible. For author/title metadata there is the xml opf file, but those are huge and overkill and not included in any of the existing device drivers. The strings themselves are, so I was just going to open the file and write the author string, a newline, the title string, newline, EOF. Maybe Author= and Title= if you want to get fancy...

Quote:
Originally Posted by Mackx View Post
Since mdbindex needs to be changed, the .metadata and .cover files can easily be excluded. (Furthermore only files with 'known' extension will be added. since .cover is not an extension linked to an application it will also not be added to global.db)
W.r.t. the extra files, mdbindex can be changed to remove the extra files once they are processed. (although this might give sync-problems with Calibre).
aha. my memory wasn't inventing things. Yeah, cleaning up the files afterward wouldn't really break anything since Calibre doesn't really 'synch' devices yet except maybe the Sony's... For everything else things only happen on "Send to device" the first time. And if it did synch, writing a new cover/metadata file would be a good way to indicate to the indexer that global.db needs updating too

Quote:
Originally Posted by Mackx View Post
The problem that I have with this is that some documents, mainly magazines, do not have correct metadata. So the extracted metadata is useless, that is why I added the extra functionality to change the metadata (and block UDS from changing it). Or do you want to use poppler to correct the metadata and let UDS extract it?
Yep, it's mostly my collection of magazines that have print/copy/etc restrictions on them that can't be changed. An on-device metadata editor would be an improvement over right now but still an extra step since Calibre knows what the real info is
Mr. X is offline   Reply With Quote