Replace PILImage.ANTIALIAS with PILImage.LANCZOS
ANTIALIAS was removed in Pillow 10
This commit is contained in:
parent
44ed146c8f
commit
40caf5f3fe
|
@ -489,7 +489,7 @@ def GenerateThumbnailBytesFromStaticImagePath( path, target_resolution, mime, cl
|
||||||
pil_image = ClipPILImage( pil_image, clip_rect )
|
pil_image = ClipPILImage( pil_image, clip_rect )
|
||||||
|
|
||||||
|
|
||||||
thumbnail_pil_image = pil_image.resize( target_resolution, PILImage.ANTIALIAS )
|
thumbnail_pil_image = pil_image.resize( target_resolution, PILImage.LANCZOS )
|
||||||
|
|
||||||
thumbnail_bytes = GenerateThumbnailBytesPIL( thumbnail_pil_image )
|
thumbnail_bytes = GenerateThumbnailBytesPIL( thumbnail_pil_image )
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@ import typing
|
||||||
|
|
||||||
from PIL import Image as PILImage
|
from PIL import Image as PILImage
|
||||||
|
|
||||||
from hydrus.core import HydrusImageHandling
|
from hydrus.core import HydrusExceptions, HydrusImageHandling
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ def PSDHasICCProfile(path: str):
|
||||||
|
|
||||||
if not PSD_TOOLS_OK:
|
if not PSD_TOOLS_OK:
|
||||||
|
|
||||||
raise Exception( 'psd_tools unavailable' )
|
raise HydrusExceptions.UnsupportedFileException( 'psd_tools unavailable' )
|
||||||
|
|
||||||
psd = PSDImage.open(path)
|
psd = PSDImage.open(path)
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ def MergedPILImageFromPSD(path: str) -> PILImage:
|
||||||
|
|
||||||
if not PSD_TOOLS_OK:
|
if not PSD_TOOLS_OK:
|
||||||
|
|
||||||
raise Exception( 'psd_tools unavailable' )
|
raise HydrusExceptions.UnsupportedFileException( 'psd_tools unavailable' )
|
||||||
|
|
||||||
psd = PSDImage.open(path)
|
psd = PSDImage.open(path)
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ def GenerateThumbnailBytesFromPSDPath(path: str, target_resolution: typing.Tuple
|
||||||
pil_image = HydrusImageHandling.ClipPILImage( pil_image, clip_rect )
|
pil_image = HydrusImageHandling.ClipPILImage( pil_image, clip_rect )
|
||||||
|
|
||||||
|
|
||||||
thumbnail_pil_image = pil_image.resize( target_resolution, PILImage.ANTIALIAS )
|
thumbnail_pil_image = pil_image.resize( target_resolution, PILImage.LANCZOS )
|
||||||
|
|
||||||
thumbnail_bytes = HydrusImageHandling.GenerateThumbnailBytesPIL( thumbnail_pil_image )
|
thumbnail_bytes = HydrusImageHandling.GenerateThumbnailBytesPIL( thumbnail_pil_image )
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue