返回提交历史
Modified
g4f/image/__init__.py
+10
-10
XFEstudio/gpt4free
Remove rotate image
b706256e
代码差异
1 个文件
+10
-10
@@ -229,16 +229,16 @@ def process_image(image: Image, new_width: int = 1000, new_height: int = 1000) -
229
229
Image: The processed image.
230
230
"""
231
231
# Fix orientation
232
orientation = get_orientation(image)
233
if orientation:
234
if orientation > 4:
235
image = image.transpose(FLIP_LEFT_RIGHT)
236
if orientation in [3, 4]:
237
image = image.transpose(ROTATE_180)
238
if orientation in [5, 6]:
239
image = image.transpose(ROTATE_270)
240
if orientation in [7, 8]:
241
image = image.transpose(ROTATE_90)
232
# orientation = get_orientation(image)
233
# if orientation:
234
# if orientation > 4:
235
# image = image.transpose(FLIP_LEFT_RIGHT)
236
# if orientation in [3, 4]:
237
# image = image.transpose(ROTATE_180)
238
# if orientation in [5, 6]:
239
# image = image.transpose(ROTATE_270)
240
# if orientation in [7, 8]:
241
# image = image.transpose(ROTATE_90)
242
242
# Resize image
243
243
image.thumbnail((new_width, new_height))
244
244
# Remove transparency