wagtail / Willow

A wrapper that combines the functionality of multiple Python image libraries into one API
https://willow.wagtail.org/
BSD 3-Clause "New" or "Revised" License
274 stars 53 forks source link

Try checking image format as a stream #17

Closed sixpearls closed 1 year ago

sixpearls commented 9 years ago

Sometimes, the file that Willow will get is a BytesIO stream rather than a path string. Since imghdr can determine the image format from the stream as well, I figure we might as well try it.

kaedroho commented 9 years ago

Thanks @sixpearls

Could you add a test and a comment in the code as well?

sixpearls commented 9 years ago

Hi @kaedroho sure, I just pushed them up. Let me know what you think.

dopry commented 2 years ago

@sixpearls I know this is a totally ancient PR. Do you think there is still a need for this feature? Do you have the time or interest in updating it? @kaedroho is this a feature that you would be interested in? It would be nice to finalize a disposition on this PR after 7 years.

zerolab commented 1 year ago

96 switched to using filetype and lots of tests now use BytesIO. Will close this PR on that basis.