View Single Post
Old 06-26-2011, 11:12 AM   #57
Iņigo
Guru
Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.Iņigo did not drink the Kool Aid.
 
Posts: 730
Karma: 72743
Join Date: Feb 2008
Location: Here or there
Device: iRex iLiad, iRex DR800S. K4NT. Kobo Aura, Aura One, Libra 2.
Quote:
Originally Posted by Mackx View Post
I commented before on this and did some experiments. UDS updates thumbnails (and other info) when a document is first shown. Notepad always updates the thumbnail when it is closed. All updates go via the function ermetadb_file.c:set_file_metadata_impl(). When a thumbnail column is found (look for '// find column in thumbnails' and further), all required information is available. cell_name contains 'thumb_data_medium'/'small'. cell is of type metadata_cell, so the blob info can easily be retrieved (metadata_cell.h). See notepad_thumbnail.cpp for the buffers that are supplied.

Not sure if you found this yourself, but I wanted to contribute also.
Thanks, this part is already finished (your previous comments were very helpful, thanks), but not in the repo yet.
I attach the new patch and the files. If anyone wants to try remember to remove global.db first (and make a backup).

There is a bug (not specially related to this patch) using UDS from DR1000 and DR800+. When indexing many files, indexer open the books with UDS to retrieve metadata and thumbnail. As we susbtituted original DR800 UDS binary with the one for DR1000, there will produce a crash on UDS eventually, so indexer won't continue.
I can't see a solution for this. So run indexer normally and if you want a cover for any book, open it manually and you'll get the image.


Remaining steps:
- handle files deleted => remove image files from disk if they exist
- settings icons are not recreated yet
- old notes thumb are not migrated (they need to be updated), but new notes get their thumb correctly
- finish the tool to move covers from global.db to file system [waiting due to a bug in vala's sqlite3 bindings]
- rewrite my "icons" app to copy images to file system instead of to global.db
- package
- profit


Iņigo

Btw, hope you had a good weekend, full of fun, sex and rock and roll!
Attached Files
File Type: gz covers_in_fs.patch.gz (4.8 KB, 424 views)
File Type: gz covers_in_fs.files.tar.gz (95.4 KB, 411 views)

Last edited by Iņigo; 06-26-2011 at 11:57 AM.
Iņigo is offline   Reply With Quote