From 477d10c7febb6f2225eb9df94d0729bbf230cd15 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Tue, 11 Aug 2015 10:39:05 +0200 Subject: [PATCH] Minor fixes. --- librarian/book2anything.py | 2 +- librarian/cover.py | 2 ++ librarian/picture.py | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/librarian/book2anything.py b/librarian/book2anything.py index 20cae8f..55ab599 100755 --- a/librarian/book2anything.py +++ b/librarian/book2anything.py @@ -125,7 +125,7 @@ class Book2Anything(object): if not (options.output_file or options.output_dir): output_file = os.path.splitext(main_input)[0] + '.' + cls.ext else: - output_file = None + output_file = options.output_file # Do the transformation. doc = WLDocument.from_file(main_input, provider=provider, **parser_args) diff --git a/librarian/cover.py b/librarian/cover.py index 21eedc3..0266b4e 100644 --- a/librarian/cover.py +++ b/librarian/cover.py @@ -142,6 +142,8 @@ class Cover(object): self.title = book_info.title if format is not None: self.format = format + if width and height: + self.height = height * self.width / width scale = max(float(width or 0) / self.width, float(height or 0) / self.height) if scale >= 1: self.scale = scale diff --git a/librarian/picture.py b/librarian/picture.py index 5a0c47b..6fc40b1 100644 --- a/librarian/picture.py +++ b/librarian/picture.py @@ -120,7 +120,7 @@ class WLPicture(object): data = data.replace(u'\ufeff', '') # assume images are in the same directory - if image_store is None and xmlfile.name is not None: + if image_store is None and getattr(xmlfile, 'name', None): image_store = ImageStore(path.dirname(xmlfile.name)) try: -- 2.20.1