parent
2849de3dc1
commit
2dd2fffffa
|
@ -14,6 +14,8 @@ def resize_img(file_path, max_size=(640, 640), quality=90):
|
|||
|
||||
if img.size[0] > max_size[0] or img.size[1] > max_size[1]:
|
||||
img.thumbnail(max_size, Image.ANTIALIAS)
|
||||
if (img.format == 'PNG'):
|
||||
img = img.convert('RGB')
|
||||
img.save(file_path, quality=quality)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue