View Single Post
Old 02-11-2016, 07:46 AM   #1
datcha
Connoisseur
datcha has a certain pleonastic somethingdatcha has a certain pleonastic somethingdatcha has a certain pleonastic somethingdatcha has a certain pleonastic somethingdatcha has a certain pleonastic somethingdatcha has a certain pleonastic somethingdatcha has a certain pleonastic somethingdatcha has a certain pleonastic somethingdatcha has a certain pleonastic somethingdatcha has a certain pleonastic somethingdatcha has a certain pleonastic something
 
Posts: 58
Karma: 18990
Join Date: Jan 2016
Device: Kobo
How to get book cover width and height in Calibre Python code?

I am trying to write a template function that gives the width and height of the cover, when there is one. But I do not know the structure of Calibre well enough, and I have be unable to sort out the class definitions to find how to access that information (I am pretty much a beginner with calibre).

For example, I understand (I think) how the template function booksize() works, but I do not see how to do something similar for the cover size.

Is there a map of the main classes used to represent books and metadata?

Alternatively, given that I have a metadata instance MI for an ebook, how can I get in Python the width and height of the cover, as integers www and hhh or as a string 'wwwxhhh'.
datcha is offline   Reply With Quote