diff --git a/setup.py b/setup.py index 37bd8c1..fa04955 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ "frozendict>=1.2", "google-auth>=1.31.0", "mock>=4.0.3", - "Pillow>=8.3.1", + "Pillow>=10.3.0", "protobuf>=3.19.0", "pytz>=2021.1", "requests>=2.25.1", diff --git a/src/google/appengine/api/images/images_stub.py b/src/google/appengine/api/images/images_stub.py index cc4ebf7..6fc3875 100755 --- a/src/google/appengine/api/images/images_stub.py +++ b/src/google/appengine/api/images/images_stub.py @@ -529,7 +529,7 @@ def _Resize(self, image, transform): new_width, new_height = self._CalculateNewDimensions( current_width, current_height, width, height, crop_to_fit, allow_stretch) - new_image = image.resize((new_width, new_height), Image.ANTIALIAS) + new_image = image.resize((new_width, new_height), Image.Resampling.LANCZOS) if crop_to_fit and (new_width > width or new_height > height): left = int((new_width - width) * transform.crop_offset_x) @@ -711,18 +711,18 @@ def _CorrectOrientation(self, image, orientation): if orientation == 2: - image = image.transpose(Image.FLIP_LEFT_RIGHT) + image = image.transpose(Image.Transpose.FLIP_LEFT_RIGHT) elif orientation == 3: image = image.rotate(180) elif orientation == 4: - image = image.transpose(Image.FLIP_TOP_BOTTOM) + image = image.transpose(Image.Transpose.FLIP_TOP_BOTTOM) elif orientation == 5: - image = image.transpose(Image.FLIP_TOP_BOTTOM) + image = image.transpose(Image.Transpose.FLIP_TOP_BOTTOM) image = image.rotate(270) elif orientation == 6: image = image.rotate(270) elif orientation == 7: - image = image.transpose(Image.FLIP_LEFT_RIGHT) + image = image.transpose(Image.Transpose.FLIP_LEFT_RIGHT) image = image.rotate(270) elif orientation == 8: image = image.rotate(90) @@ -789,11 +789,11 @@ def _ProcessTransforms(self, image, transforms, correct_orientation): elif transform.HasField('horizontal_flip'): - new_image = new_image.transpose(Image.FLIP_LEFT_RIGHT) + new_image = new_image.transpose(Image.Transpose.FLIP_LEFT_RIGHT) elif transform.HasField('vertical_flip'): - new_image = new_image.transpose(Image.FLIP_TOP_BOTTOM) + new_image = new_image.transpose(Image.Transpose.FLIP_TOP_BOTTOM) elif (transform.HasField('crop_left_x') or transform.HasField('crop_top_y') or