Quote:
Originally Posted by chaley
There is no existing built-in way to get the cover size. It can be done in a python template but that requires opening the cover to compute its size, which could be too slow to use. What is "too slow" is up to you.
The template returns the cover size as "width by height". You can play with the formatting.
Code:
python:
def evaluate(book, context):
db = context.db.new_api
cover = db.cover(book.id, as_image=True)
width = cover.width()
height = cover.height()
if width and height:
return f'{str(width)} by {str(height)}'
return '--'
|
Also attached is an Action Chain (
instructions to install) will writes the template output to a
#coversize column with less performance issues.