From: Radek Czajka Date: Tue, 11 Aug 2015 08:39:05 +0000 (+0200) Subject: Minor fixes. X-Git-Tag: 1.7~86 X-Git-Url: https://git.mdrn.pl/librarian.git/commitdiff_plain/477d10c7febb6f2225eb9df94d0729bbf230cd15?hp=ff2a09e9ecd8e9bede2d3572942bcd32f66f6198 Minor fixes. --- 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: