From a07a4a9202091de4902baa709e7ec83c837eb4b5 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 3 Apr 2012 10:26:01 +0200 Subject: [PATCH] #2044: handle weird whitespace for covers --- librarian/cover.py | 2 ++ setup.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/librarian/cover.py b/librarian/cover.py index 23603d6..925449e 100644 --- a/librarian/cover.py +++ b/librarian/cover.py @@ -3,6 +3,7 @@ # This file is part of Librarian, licensed under GNU Affero GPLv3 or later. # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # +import re import Image, ImageFont, ImageDraw, ImageFilter from librarian import get_resource @@ -36,6 +37,7 @@ class TextBox(object): def text(self, text, color='#000', font=None, line_height=20, shadow_color=None): """Writes some centered text.""" + text = re.sub(r'\s+', ' ', text) if shadow_color: if not self.shadow_img: self.shadow_img = Image.new('RGBA', self.img.size) diff --git a/setup.py b/setup.py index b1ea926..7ea9ed0 100755 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ def whole_tree(prefix, path): setup( name='librarian', - version='1.4.1', + version='1.4.2a', description='Converter from WolneLektury.pl XML-based language to XHTML, TXT and other formats', author="Marek Stępniowski", author_email='marek@stepniowski.com', -- 2.20.1