Jan-21-2021, 07:17 PM
Please guys don't tell me that I must use the save to path and load from path
def reduce_image_size(dmy): with open('MyTempImage.jpg', 'wb') as f: f.write(dmy) f.close() image =Image.open('MyTempImage.jpg') image.save('MyTempImageOUT.jpg',quality=20,optimize=True) with open('MyTempImageOUT.jpg', "rb") as rawimg: return rawimg