View Single Post
Old 07-04-2011, 06:30 PM   #75
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
@Mr. X.: can you point me to some documents about the format of the .metadata and .cover files from Calibre?
Actually, it looks like pretty much the entire .opf file is already copied by Calibre, just as JSON instead of XML and put in a single file (metadata.calibre at the root of the memory card). Each book has an entry like so:

Code:
  {
    "rating": 0, 
    "author_sort": "Lessig, Lawrence", 
    "application_id": 238, 
    "pubdate": "2006-02-15T05:00:00+00:00", 
    "series": null, 
    "author_sort_map": {
      "Lawrence Lessig": "Lessig, Lawrence"
    }, 
    "publication_type": null, 
    "size": 4334892, 
    "author_link_map": {
      "Lawrence Lessig": ""
    }, 
    "uuid": "1edb160e-2306-45a7-8fdb-e204b5213a33", 
    "title": "Code 2.0", 
    "user_categories": {}, 
    "comments": "<p class=\"description\">SUMMARY:<br>There\u2019s a common belief that cyberspace cannot be regulated-that it is, in its very essence, immune from the government\u2019s (or anyone else\u2019s) control. Code, first published in 2000, argues that this belief is wrong. It is not in the nature of cyberspace to be unregulable; cyberspace has no \u201cnature.\u201d It only has code-the software and hardware that make cyberspace what it is. That code can create a place of freedom-as the original architecture of the Net did-or a place of oppressive control. Under the influence of commerce, cyberspace is becoming a highly regulable space, where behavior is much more tightly controlled than in real space. But that\u2019s not inevitable either. We can-we must-choose what kind of cyberspace we want and what freedoms we will guarantee. These choices are all about architecture: about what kind of code will govern cyberspace, and who will control it. In this realm, code is the most significant form of law, and it is up to lawyers, policymakers, and especially citizens to decide what values that code embodies. Since its original publication, this seminal book has earned the status of a minor classic. This second edition, or Version 2.0, has been prepared through the author\u2019s wiki, a web site that allows readers to edit the text, making this the first reader-edited revision of a popular book.</p>", 
    "languages": [], 
    "user_metadata": {}, 
    "thumbnail": [
      45, 
      68, 
      "/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAAoHBwgHBgoICAgLCgoLDhg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KBseHPU41NTSW/v0EvV/dH//2Q=="
    ], 
    "db_id": null, 
    "tags": [
      "_type:Book"
    ], 
    "timestamp": "2010-02-23T05:00:00+00:00", 
    "mime": null, 
    "authors": [
      "Lawrence Lessig"
    ], 
    "publisher": "New York : Basic Books, c2006.", 
    "series_index": null, 
    "lpath": "Books/Lessig, Lawrence/Code 2.0 - Lawrence Lessig.pdf", 
    "language": "und", 
    "rights": null, 
    "title_sort": "Code 2.0", 
    "cover": null, 
    "book_producer": null, 
    "identifiers": {
      "isbn": "9780465039142"
    }
  },
The thumbnail is a base64 encoded jpg, resized to a height of 68 pixels. Not sure how bad those would look resizing them up to 120px for the cover view (that's what uses the medium version, right?), or if there is base64 decoding support on the device already (presumably jpg to png support is there already, although maybe it relies on uds for that part...).

But the nook driver provides an example of how to put a higher resolution cover (or pair of covers) in the filesystem, and you could move those to .covers when indexing as you suggested if pulling the thumbnail from metadata.calibre turns out not to work or look good.
Mr. X is offline   Reply With Quote