File tree Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Expand file tree Collapse file tree 2 files changed +8
-5
lines changed Original file line number Diff line number Diff line change 1313import boto3
1414import cv2
1515import ffmpeg
16- from PIL import Image
16+ from PIL import Image , ImageOps , ImageChops
1717from tqdm import tqdm
1818
1919from ..api import API
@@ -600,11 +600,14 @@ def upload_images_from_folder_to_project(
600600
601601def get_image_array_to_upload (byte_io_orig , image_quality_in_editor ):
602602 Image .MAX_IMAGE_PIXELS = None
603- im = Image .open (byte_io_orig )
604- im_format = im .format
603+ im_original = Image .open (byte_io_orig )
604+ im_format = im_original .format
605+ im = ImageOps .exif_transpose (im_original )
605606 width , height = im .size
606607
607- if image_quality_in_editor == 100 and im_format in ['JPEG' , 'JPG' ]:
608+ if image_quality_in_editor == 100 and im_format in [
609+ 'JPEG' , 'JPG'
610+ ] and not ImageChops .difference (im , im_original ).getbbox ():
608611 byte_io_lores = io .BytesIO (byte_io_orig .getbuffer ())
609612 else :
610613 byte_io_lores = io .BytesIO ()
Original file line number Diff line number Diff line change 1- __version__ = "2.3.17 "
1+ __version__ = "2.3.18 "
You can’t perform that action at this time.
0 commit comments