Browse Source

Resize portrait images to same size as landscape

With the current approach images are resized along the width, which means images
in portrait mode are substantially smaller than landscape images. This change
resizes portrait images along the height so that they will cover the exact same
area.
pull/258/head
Matthias Vogelgesang 9 years ago
parent
commit
7ab13308b3
  1. 8
      sigal/image.py

8
sigal/image.py

@ -118,7 +118,13 @@ def generate_image(source, outname, settings, options=None):
logger.error('Wrong processor name: %s', settings['img_processor'])
sys.exit()
processor = processor_cls(*settings['img_size'], upscale=False)
width, height = settings['img_size']
if img.size[0] < img.size[1]:
# swap target size if image is in portrait mode
height, width = width, height
processor = processor_cls(width, height, upscale=False)
img = processor.process(img)
# signal.send() does not work here as plugins can modify the image, so we

Loading…
Cancel
Save