Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep the aspect ratio through ImageOps.fit #3

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions nasa_apod_desktop.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
import urllib2
import re
import os
from PIL import Image
from PIL import Image, ImageOps
from sys import stdout

# Configurable settings:
Expand Down Expand Up @@ -128,7 +128,7 @@ def resize_image(filename):
image = Image.open(filename)
if SHOW_DEBUG:
print "Resizing the image to", RESOLUTION_X, 'x', RESOLUTION_Y
image = image.resize((RESOLUTION_X, RESOLUTION_Y), Image.ANTIALIAS)
image = ImageOps.fit(image, (RESOLUTION_X, RESOLUTION_Y), Image.ANTIALIAS, 0, (0.5, 0.5))

if SHOW_DEBUG:
print "Saving the image to", filename
Expand Down