mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2025-12-12 09:10:30 +08:00
Fix for Pillow 10.x
This commit is contained in:
parent
4e9d93b2b1
commit
e0c32c2111
@ -148,7 +148,7 @@ class Ocr:
|
||||
image = image_cropped
|
||||
|
||||
ImageOps.grayscale(image)
|
||||
image_resized = image.resize((int(image.size[0] * 2), int(image.size[1] * 2)), PilImage.BICUBIC)
|
||||
image_resized = image.resize((int(image.size[0] * 2), int(image.size[1] * 2)), PilImage.Resampling.BICUBIC)
|
||||
image.close()
|
||||
image = image_resized
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ class StreamerSnapshot:
|
||||
with io.BytesIO(self.data) as snapshot_bio:
|
||||
with io.BytesIO() as preview_bio:
|
||||
with PilImage.open(snapshot_bio) as image:
|
||||
image.thumbnail((max_width, max_height), PilImage.ANTIALIAS)
|
||||
image.thumbnail((max_width, max_height), PilImage.Resampling.LANCZOS)
|
||||
image.save(preview_bio, format="jpeg", quality=quality)
|
||||
return preview_bio.getvalue()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user