From 0c8641faa17ecc68e142ef3e4ca68c2df59ec709 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 16 Jul 2011 20:29:04 -0600 Subject: [PATCH] ... --- src/calibre/ebooks/mobi/writer.py | 3 ++- src/calibre/manual/faq.rst | 2 +- src/calibre/manual/gui.rst | 3 ++- src/calibre/utils/magick/draw.py | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/calibre/ebooks/mobi/writer.py b/src/calibre/ebooks/mobi/writer.py index 0c4f54c25c..2787e66466 100644 --- a/src/calibre/ebooks/mobi/writer.py +++ b/src/calibre/ebooks/mobi/writer.py @@ -111,7 +111,8 @@ def align_block(raw, multiple=4, pad='\0'): def rescale_image(data, maxsizeb, dimen=None): if dimen is not None: - data = thumbnail(data, width=dimen, height=dimen)[-1] + data = thumbnail(data, width=dimen[0], height=dimen[1], + compression_quality=90)[-1] else: # Replace transparent pixels with white pixels and convert to JPEG data = save_cover_data_to(data, 'img.jpg', return_data=True) diff --git a/src/calibre/manual/faq.rst b/src/calibre/manual/faq.rst index 5ae57d093b..5601407282 100644 --- a/src/calibre/manual/faq.rst +++ b/src/calibre/manual/faq.rst @@ -407,7 +407,7 @@ If you are worried that someday |app| will cease to be developed, leaving all yo Since I keep getting asked why there are numbers at the end of the title folder name, the reason is for *robustness*. That number is the id number of the book record in the |app| database. The presence of the number allows you to have multiple records with the same title and author names. More importantly, it is part of what allows |app| to magically regenerate the database with all metadata if the database file gets corrupted. Given that |app|'s mission is to get you to stop storing metadata in filenames and stop using the filesystem to find things, the increased robustness afforded by the id numbers is well worth the uglier folder names. -Finally, if you are irrevocably wedded to the filesystem, feel free to patch your local copy of |app| to use whatever storage scheme you like. But, do not bother me with requests to change the directory structure, **they will be ignored**. +Finally, if you are irrevocably wedded to using the filesystem to store your metadata, feel free to patch your local copy of |app| to use whatever storage scheme you like. But, do not bother me with requests to change the directory structure, **they will be ignored**. Why doesn't |app| have a column for foo? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/src/calibre/manual/gui.rst b/src/calibre/manual/gui.rst index 418e19eab6..520206343f 100755 --- a/src/calibre/manual/gui.rst +++ b/src/calibre/manual/gui.rst @@ -104,7 +104,8 @@ The :guilabel:`Convert books` action has three variations, accessed by the arrow This allows you to use the search features to limit the books to be catalogued. In addition, if you select multiple books using the mouse, only those books will be added to the catalog. If you generate the catalog in an ebook format such as EPUB or MOBI, the next time you connect your ebook reader the catalog will be automatically sent to the device. - For more information on how catalogs work, read the `catalog creation tutorial `_at MobileRead. + For more information on how catalogs work, read the `catalog creation tutorial `_ + at MobileRead. .. _view: diff --git a/src/calibre/utils/magick/draw.py b/src/calibre/utils/magick/draw.py index fdce30177a..1e854b0f56 100644 --- a/src/calibre/utils/magick/draw.py +++ b/src/calibre/utils/magick/draw.py @@ -107,7 +107,7 @@ def save_cover_data_to(data, path, bgcolor='#ffffff', resize_to=None, return ret def thumbnail(data, width=120, height=120, bgcolor='#ffffff', fmt='jpg', - preserve_aspect_ratio=True): + preserve_aspect_ratio=True, compression_quality=70): img = Image() img.load(data) owidth, oheight = img.size @@ -122,7 +122,7 @@ def thumbnail(data, width=120, height=120, bgcolor='#ffffff', fmt='jpg', canvas = create_canvas(img.size[0], img.size[1], bgcolor) canvas.compose(img) if fmt == 'jpg': - canvas.set_compression_quality(70) + canvas.set_compression_quality(compression_quality) return (canvas.size[0], canvas.size[1], canvas.export(fmt)) def identify_data(data):