The solutions I have found said to:
from PIL import Image
import io
img = "1.jpg"
image = Image.open(img)
# ... other processing...
buf = io.BytesIO()
image.save(buf, format="JPEG")
buf.get_value()
But I get the error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: '_io.BytesIO' object has no attribute 'get_value'
If I try instead:
buf.seek(0)
It just outputs 0.
Those are the only two suggestions I have found and they are not working for me. Is it an issue with my versions? I have Python 3.7.3 and PIL 6.1.0