Only ensure the maximum width.
This commit is contained in:
parent
f488935072
commit
732b50811d
2 changed files with 4 additions and 2 deletions
|
@ -1,7 +1,7 @@
|
||||||
Dosage 2.9 (released xx.xx.2013)
|
Dosage 2.9 (released xx.xx.2013)
|
||||||
|
|
||||||
Features:
|
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,
|
- comics: Added EdmundFinney, Gaia, GaiaGerman, InternetWebcomic,
|
||||||
NotInventedHere, RedsPlanet, RomanticallyApocalyptic,
|
NotInventedHere, RedsPlanet, RomanticallyApocalyptic,
|
||||||
ScandinaviaAndTheWorld, TheGamerCat, Weregeek.
|
ScandinaviaAndTheWorld, TheGamerCat, Weregeek.
|
||||||
|
|
|
@ -9,6 +9,7 @@ except ImportError:
|
||||||
import codecs
|
import codecs
|
||||||
import json
|
import json
|
||||||
from . import rss, util, configuration
|
from . import rss, util, configuration
|
||||||
|
from .output import out
|
||||||
|
|
||||||
# Maximum width or height to display an image in exported pages.
|
# Maximum width or height to display an image in exported pages.
|
||||||
# Note that only the displayed size is adjusted, not the image itself.
|
# Note that only the displayed size is adjusted, not the image itself.
|
||||||
|
@ -124,8 +125,9 @@ def getDimensionForImage(filename, maxsize):
|
||||||
return None
|
return None
|
||||||
img = Image.open(filename)
|
img = Image.open(filename)
|
||||||
width, height = img.size
|
width, height = img.size
|
||||||
if width > maxsize and height > maxsize:
|
if width > maxsize:
|
||||||
img.thumbnail(maxsize)
|
img.thumbnail(maxsize)
|
||||||
|
out.info("Downscaled display size from %s to %s" % ((width, height), img.size))
|
||||||
return img.size
|
return img.size
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue