Only ensure the maximum width.

This commit is contained in:
Bastian Kleineidam 2013-12-22 13:38:29 +01:00
parent f488935072
commit 732b50811d
2 changed files with 4 additions and 2 deletions

View file

@ -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.

View file

@ -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