Merge pull request #1770 from pyfa-org/issue/1769

Don't include 2x version of icons that don't have a larger version.
This commit is contained in:
Ryan Holmes
2018-10-13 20:50:39 -04:00
committed by GitHub
10 changed files with 5 additions and 0 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 773 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 787 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 602 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 462 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 730 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 638 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

View File

@@ -150,6 +150,11 @@ def get_icon_file(res_path, size):
if not os.path.isfile(fullpath):
return None
img = Image.open(fullpath)
if size > img.size:
# if we are requesting a size that is bigger than the source, return None. See #1769
return None
img = crop_image(img)
img.thumbnail(size, Image.ANTIALIAS)