#boto3 version = 1.28.3
#botocore version = 1.31.65
import boto3
from PIL import Image
from io import BytesIO
s3 = boto3.client('s3')
new_obj = s3.get_object(Bucket=bucket, Key="path/to/image_folder/image_3.jpg")
image_dl = new_obj['Body'].read()
image = Image.open(BytesIO(image_dl))
Error:
PIL.UnidentifiedImageError: Cannot identify image file
Any suggestions will be helpful