From 9cee1089b4ae03968e8b91503a8cbddc402fcc1a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 14 Jul 2011 21:25:20 -0600 Subject: [PATCH] ... --- src/calibre/db/cache.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/db/cache.py b/src/calibre/db/cache.py index 65f7f984a2..5d8c6aef4d 100644 --- a/src/calibre/db/cache.py +++ b/src/calibre/db/cache.py @@ -302,7 +302,8 @@ class Cache(object): def cover(self, book_id, as_file=False, as_image=False, as_path=False): ''' - Return the cover image as a bytestring (in JPEG format) or None. + Return the cover image or None. By default, returns the cover as a + bytestring. WARNING: Using as_path will copy the cover to a temp file and return the path to the temp file. You should delete the temp file when you are @@ -310,6 +311,8 @@ class Cache(object): :param as_file: If True return the image as an open file object (a SpooledTemporaryFile) :param as_image: If True return the image as a QImage object + :param as_path: If True return the image as a path pointing to a + temporary file ''' with self.read_lock: try: