Skip to content

MAINT: Cleanly determine write format in pillow - #752

Merged
FirefoxMetzger merged 10 commits into
imageio:masterfrom
FirefoxMetzger:pillow-write-bytes
Mar 9, 2022
Merged

FirefoxMetzger merged 10 commits into
imageio:masterfrom
FirefoxMetzger:pillow-write-bytes

Conversation

@FirefoxMetzger

@FirefoxMetzger FirefoxMetzger commented Feb 11, 2022 •

Copy link
Copy Markdown
Contributor

Closes: #498, #604
Solves 50% of: #324

This PR cleans up the way pillow determines if it can write a format or not and makes use of format_hint to choose the writing format when writing to file/likes.

It also adds a few extensions that pillow supports but that we didn't track explicitly yet. Most notably: PDF (writing only) and WEBP (reading and writing). I"ll add a snippet to both issues.

@FirefoxMetzger

Copy link
Copy Markdown
Contributor Author

@almarklein RTR :)

I also removed a helper function that we no longer need. We had it as a wrapper around a pillow function, because pillow was a bit inconsistent (the function didn't support all modes pillow officially mentioned). I added a PR upstream to fix that and now we can remove the helper here and simply match pillow's behavior.

@FirefoxMetzger

Copy link
Copy Markdown
Contributor Author

bumping this since it hasn't received any activity for a while. Are you able to review @almarklein? If not, I can find a different solution, just let me know :)

@FirefoxMetzger FirefoxMetzger linked an issue Mar 5, 2022 that may be closed by this pull request

@almarklein almarklein left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just one question.

Comment thread imageio/config/extensions.py Resolved
@FirefoxMetzger
FirefoxMetzger merged commit 8cba510 into imageio:master Mar 9, 2022
@FirefoxMetzger
FirefoxMetzger deleted the pillow-write-bytes branch March 9, 2022 21:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support WebP Animations webp writer writes 0 bytes to BytesIO

2 participants