fix: upload switch & deprecated ANTIALIAS

This commit is contained in:
2024-01-14 14:37:31 +01:00
parent b980ef46df
commit c47ae8741a

View File

@@ -15,7 +15,7 @@ PICTURE_DIR = os.environ.get("PICTURES_DIRECTORY") or "pictures/"
app.config['UPLOAD_FOLDER'] = PICTURE_DIR app.config['UPLOAD_FOLDER'] = PICTURE_DIR
ENV_UPLOAD_ENABLED = os.environ.get("UPLOAD_ENABLED").lower() in ["yes", "true", "1"] ENV_UPLOAD_ENABLED = os.environ.get("UPLOAD_ENABLED").lower() in ["yes", "true", "1"]
app.config['UPLOAD_ENABLED'] = os.path.isfile("./upload.enable") or app.config['UPLOAD_ENABLED'] = os.path.isfile("./upload.enable") or ENV_UPLOAD_ENABLED
def generatePicture(pathToOrig, scaleX, scaleY, encoding, crop): def generatePicture(pathToOrig, scaleX, scaleY, encoding, crop):
'''Generate an pictures with the requested scales and encoding if it doesn't already exist''' '''Generate an pictures with the requested scales and encoding if it doesn't already exist'''
@@ -71,7 +71,7 @@ def generatePicture(pathToOrig, scaleX, scaleY, encoding, crop):
print(scaleX, scaleY) print(scaleX, scaleY)
else: else:
print("scale") print("scale")
image.thumbnail((scaleX, scaleY), PIL.Image.ANTIALIAS) image.thumbnail((scaleX, scaleY), PIL.Image.LANCZOS)
image.save(newPath, encoding) image.save(newPath, encoding)