Image is corrupted after PIL's tobytes() method

I want to upload an image to a Google Bucket, however I want to reduce the size of the image before uploading. When I don’t call the self._resize_image method the image gets successfully uploaded without any problems. However, when I call the resize method it works until the image.tobytes() method. After the image.tobytes() method is… Read More Image is corrupted after PIL's tobytes() method