-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
Description
What did you do?
https://upload.wikimedia.org/wikipedia/commons/3/39/Oatmeal.jpg
Using the above linked image, I did the following within an IDLE session:
>>> from PIL import Image, ImageOps
>>> import io, os
>>> size = (100,100)
>>> img = Image.open("C:/Oatmeal.jpg")
>>> temp = ImageOps.contain(img, size)
>>> temp.show()
>>> buff = io.BytesIO()
>>> temp.save(buff, format='jpeg', quality=100, subsampling=0)
>>> wranglebuff = Image.open(buff)
>>> wranglebuff.show()
>>> temp.save(buff, format='png')
>>> wranglebuff = Image.open(buff)
>>> wranglebuff.show()What did you expect to happen?
I expected the second show() in the buffer to be different (higher quality) than the first show() of the buffer.
What actually happened?
Both buffer show() invocations show the exact same image. It is possible that calling save() to the same in-memory object twice will continuously append to the stream as opposed to overwriting.
What are your OS, Python and Pillow versions?
- OS: Windows 10
- Python: 3.9.0
- Pillow: 11.3.0
Reactions are currently unavailable