mirror of
https://github.com/f-droid/fdroidserver.git
synced 2026-06-24 00:28:51 -04:00
update: PIL.Image constants moved to Resampling
This commit is contained in:
committed by
Michael Pöhn
parent
02139d196d
commit
da58dc7c0a
@@ -53,6 +53,9 @@ from binascii import hexlify
|
||||
|
||||
from PIL import Image, PngImagePlugin
|
||||
|
||||
if not hasattr(Image, 'Resampling'): # Pillow<9.0
|
||||
Image.Resampling = Image
|
||||
|
||||
import fdroidserver.index
|
||||
|
||||
from . import _, common, metadata
|
||||
@@ -324,7 +327,7 @@ def resize_icon(iconpath, density):
|
||||
|
||||
if any(length > size for length in im.size):
|
||||
oldsize = im.size
|
||||
im.thumbnail((size, size), Image.LANCZOS)
|
||||
im.thumbnail((size, size), Image.Resampling.LANCZOS)
|
||||
logging.debug("%s was too large at %s - new size is %s" % (
|
||||
iconpath, oldsize, im.size))
|
||||
im.save(iconpath, "PNG", optimize=True,
|
||||
@@ -2397,7 +2400,7 @@ def fill_missing_icon_densities(empty_densities, icon_filename, apk, repo_dir):
|
||||
|
||||
size = dpi_to_px(density)
|
||||
|
||||
im.thumbnail((size, size), Image.LANCZOS)
|
||||
im.thumbnail((size, size), Image.Resampling.LANCZOS)
|
||||
im.save(icon_path, "PNG", optimize=True,
|
||||
pnginfo=BLANK_PNG_INFO, icc_profile=None)
|
||||
empty_densities.remove(density)
|
||||
|
||||
Reference in New Issue
Block a user