From d731515ad452f24872d6abcee8516169ac2c6e57 Mon Sep 17 00:00:00 2001 From: GRiker Date: Tue, 14 Sep 2010 14:39:13 -0600 Subject: [PATCH 1/2] GwR revisions --- src/calibre/customize/profiles.py | 6 ++++-- src/calibre/ebooks/oeb/transforms/jacket.py | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index 1563f764ca..b9a159ee7d 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -555,9 +555,11 @@ class KindleOutput(OutputProfile): periodical_date_in_title = False @classmethod +# def tags_to_string(cls, tags): +# return u'%s
%s' % (', '.join(tags), +# 'ttt '.join(tags)+'ttt ') def tags_to_string(cls, tags): - return u'%s
%s' % (', '.join(tags), - 'ttt '.join(tags)+'ttt ') + return u'%s' % (', '.join(tags)) class KindleDXOutput(OutputProfile): diff --git a/src/calibre/ebooks/oeb/transforms/jacket.py b/src/calibre/ebooks/oeb/transforms/jacket.py index dc1d2fea41..ff192ca537 100644 --- a/src/calibre/ebooks/oeb/transforms/jacket.py +++ b/src/calibre/ebooks/oeb/transforms/jacket.py @@ -55,10 +55,11 @@ class Jacket(object): img = I(fname, data=True) if self.opts.output_profile.short_name == 'kindle': + # Original star.png size: 24x23 + # Needs to be scaled by half fname = 'star.jpg' img = save_cover_data_to(img, fname, - return_data=True) - + return_data=True, resize_to=[12,12]) id, href = self.oeb.manifest.generate('calibre_jacket_star', fname) self.oeb.manifest.add(id, href, guess_type(fname)[0], data=img) @@ -97,7 +98,7 @@ class Jacket(object): # Render Jacket {{{ -def get_rating(rating, href): +def get_rating(rating, href, output_profile): ans = '' try: num = float(rating)/2 @@ -114,6 +115,7 @@ def get_rating(rating, href): href, int(num))) else: ans = u' '.join(u'\u2605') + return ans @@ -138,7 +140,7 @@ def render_jacket(mi, output_profile, star_href=None, except: pubdate = '' - rating = get_rating(mi.rating, star_href) + rating = get_rating(mi.rating, star_href, output_profile) tags = mi.tags if mi.tags else alt_tags if tags: From e0afe753ccaa45e2e7ca6da602132bf6d25ef0db Mon Sep 17 00:00:00 2001 From: GRiker Date: Wed, 15 Sep 2010 04:55:08 -0600 Subject: [PATCH 2/2] GR wip --- src/calibre/customize/profiles.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/calibre/customize/profiles.py b/src/calibre/customize/profiles.py index b9a159ee7d..97b84f1286 100644 --- a/src/calibre/customize/profiles.py +++ b/src/calibre/customize/profiles.py @@ -555,11 +555,9 @@ class KindleOutput(OutputProfile): periodical_date_in_title = False @classmethod -# def tags_to_string(cls, tags): -# return u'%s
%s' % (', '.join(tags), -# 'ttt '.join(tags)+'ttt ') def tags_to_string(cls, tags): - return u'%s' % (', '.join(tags)) + return u'%s
%s' % (', '.join(tags), + 'ttt '.join(tags)+'ttt ') class KindleDXOutput(OutputProfile):