Skip to content
This repository has been archived by the owner on Oct 16, 2020. It is now read-only.

Commit

Permalink
Converted to RGB earlier in PIL image cycle to avoid issues with B&W …
Browse files Browse the repository at this point in the history
…photos
  • Loading branch information
markubiak committed Jan 3, 2018
1 parent 928125e commit 52190f1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='wallpaper-reddit',
version='3.1.0',
version='3.1.1',
packages=find_packages(),
url='https://www.github.com/markubiak/wallpaper-reddit',
author='Mark Kubiak',
Expand Down
6 changes: 3 additions & 3 deletions wpreddit/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ def download_image(url, title):
f = request.urlopen(uaurl)
print("downloading " + url)
try:
img = Image.open(f)
img = Image.open(f).convert('RGB')
if config.resize:
config.log("resizing the downloaded wallpaper")
img = ImageOps.fit(img, (config.minwidth, config.minheight), Image.ANTIALIAS)
if config.settitle:
img = set_image_title(img, title)
if config.opsys == "Windows":
img.convert('RGB').save(config.walldir + '\\wallpaper.bmp', "BMP")
img.save(config.walldir + '\\wallpaper.bmp', "BMP")
else:
img.convert('RGB').save(config.walldir + '/wallpaper.jpg', "JPEG")
img.save(config.walldir + '/wallpaper.jpg', "JPEG")

except IOError:
print("Error saving image!")
Expand Down

0 comments on commit 52190f1

Please sign in to comment.