Przeglądaj źródła

chore(deps): Bump Pillow from 9.0.1 to 9.1.1

Includes security fixes, API & constants deprecations

Changelog: https://pillow.readthedocs.io/en/stable/releasenotes/index.html
version-14
Gavin D'souza 3 lat temu
rodzic
commit
fc422f4a97
4 zmienionych plików z 6 dodań i 8 usunięć
  1. +2
    -2
      frappe/core/doctype/file/file.py
  2. +1
    -1
      frappe/utils/data.py
  3. +2
    -4
      frappe/utils/image.py
  4. +1
    -1
      requirements.txt

+ 2
- 2
frappe/core/doctype/file/file.py Wyświetl plik

@@ -341,9 +341,9 @@ class File(Document):

size = width, height
if crop:
image = ImageOps.fit(image, size, Image.ANTIALIAS)
image = ImageOps.fit(image, size, Image.Resampling.LANCZOS)
else:
image.thumbnail(size, Image.ANTIALIAS)
image.thumbnail(size, Image.Resampling.LANCZOS)

thumbnail_url = f"{filename}_{suffix}.{extn}"
path = os.path.abspath(frappe.get_site_path("public", thumbnail_url.lstrip("/")))


+ 1
- 1
frappe/utils/data.py Wyświetl plik

@@ -1349,7 +1349,7 @@ def get_thumbnail_base64_for_image(src):

original_size = image.size
size = 50, 50
image.thumbnail(size, Image.ANTIALIAS)
image.thumbnail(size, Image.Resampling.LANCZOS)

base64_string = image_to_base64(image, extn)
return {


+ 2
- 4
frappe/utils/image.py Wyświetl plik

@@ -7,8 +7,6 @@ from PIL import Image


def resize_images(path, maxdim=700):
from PIL import Image

size = (maxdim, maxdim)
for basepath, folders, files in os.walk(path):
for fname in files:
@@ -16,7 +14,7 @@ def resize_images(path, maxdim=700):
if extn in ("jpg", "jpeg", "png", "gif"):
im = Image.open(os.path.join(basepath, fname))
if im.size[0] > size[0] or im.size[1] > size[1]:
im.thumbnail(size, Image.ANTIALIAS)
im.thumbnail(size, Image.Resampling.LANCZOS)
im.save(os.path.join(basepath, fname))

print("resized {0}".format(os.path.join(basepath, fname)))
@@ -56,7 +54,7 @@ def optimize_image(
image = Image.open(io.BytesIO(content))
image_format = content_type.split("/")[1]
size = max_width, max_height
image.thumbnail(size, Image.LANCZOS)
image.thumbnail(size, Image.Resampling.LANCZOS)

output = io.BytesIO()
image.save(


+ 1
- 1
requirements.txt Wyświetl plik

@@ -33,7 +33,7 @@ parse~=1.19.0
passlib~=1.7.4
paytmchecksum~=1.7.0
pdfkit~=1.0.0
Pillow~=9.0.0
Pillow~=9.1.1
premailer~=3.8.0
psutil~=5.9.1
psycopg2-binary~=2.9.1


Ładowanie…
Anuluj
Zapisz