diff --git a/src/calibre/ebooks/__init__.py b/src/calibre/ebooks/__init__.py index a1026e97d6..084b91430f 100644 --- a/src/calibre/ebooks/__init__.py +++ b/src/calibre/ebooks/__init__.py @@ -240,7 +240,7 @@ def generate_masthead(title, output_path=None, width=600, height=60): font = ImageFont.truetype(font_path, 48) except: font = ImageFont.truetype(default_font, 48) - text = title.encode('utf-8') + text = title.encode('utf-8') if isinstance(title, unicode) else title width, height = draw.textsize(text, font=font) left = max(int((width - width)/2.), 0) top = max(int((height - height)/2.), 0)