mirror of
https://github.com/rommapp/romm.git
synced 2026-06-30 15:55:54 +00:00
The previous implementation was calling `resize_cover_to_small` within the context manager that was writing the image to the filesystem. This was causing `PIL` to raise an error because it could not identify the open and temporarily created file as a valid image. Instead of saving the original image to the filesystem and then resizing it, we now open the image in memory, resize it, and then save it to the filesystem. We also avoid reading the `BytesIO` object twice by saving small and big images from the same initial `Image` object. Fixes #1191.