fix: 🔄 fix image rotation issue on mobile
This commit is contained in:
parent
bfd37041d9
commit
5fd040cc04
1 changed files with 2 additions and 1 deletions
|
|
@ -1,11 +1,12 @@
|
||||||
from io import BytesIO
|
from io import BytesIO
|
||||||
|
|
||||||
from django.core.files import File
|
from django.core.files import File
|
||||||
from PIL import Image
|
from PIL import Image, ImageOps
|
||||||
|
|
||||||
|
|
||||||
def _convert_image_to_webp(image_file):
|
def _convert_image_to_webp(image_file):
|
||||||
image = Image.open(image_file)
|
image = Image.open(image_file)
|
||||||
|
ImageOps.exif_transpose(image, in_place=True)
|
||||||
image.convert("RGB")
|
image.convert("RGB")
|
||||||
image.thumbnail((486, 486))
|
image.thumbnail((486, 486))
|
||||||
thumb_io = BytesIO()
|
thumb_io = BytesIO()
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue