From 732b50811d68559a6a7ef2c15bc94be729078a24 Mon Sep 17 00:00:00 2001 From: Bastian Kleineidam Date: Sun, 22 Dec 2013 13:38:29 +0100 Subject: [PATCH] Only ensure the maximum width. --- doc/changelog.txt | 2 +- dosagelib/events.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/changelog.txt b/doc/changelog.txt index e41601dee..40a6e6168 100644 --- a/doc/changelog.txt +++ b/doc/changelog.txt @@ -1,7 +1,7 @@ Dosage 2.9 (released xx.xx.2013) Features: -- events: Ensure maximum aspect ratio on displayed RSS images. +- events: Ensure maximum display width on RSS and HTML images. - comics: Added EdmundFinney, Gaia, GaiaGerman, InternetWebcomic, NotInventedHere, RedsPlanet, RomanticallyApocalyptic, ScandinaviaAndTheWorld, TheGamerCat, Weregeek. diff --git a/dosagelib/events.py b/dosagelib/events.py index 6b64020ea..013b5a001 100644 --- a/dosagelib/events.py +++ b/dosagelib/events.py @@ -9,6 +9,7 @@ except ImportError: import codecs import json from . import rss, util, configuration +from .output import out # Maximum width or height to display an image in exported pages. # Note that only the displayed size is adjusted, not the image itself. @@ -124,8 +125,9 @@ def getDimensionForImage(filename, maxsize): return None img = Image.open(filename) width, height = img.size - if width > maxsize and height > maxsize: + if width > maxsize: img.thumbnail(maxsize) + out.info("Downscaled display size from %s to %s" % ((width, height), img.size)) return img.size