shibukawa / imagesize_py

MIT License
222 stars 43 forks source link

Support paths as pathlib.Path (or anything convertible to str) #26

Closed s3cur3 closed 4 years ago

s3cur3 commented 5 years ago

Python 3 code commonly represents paths as pathlib Path objects, rather than strs. This patch makes get() and getDPI() silently accept Path objects, in a way that's backward compatible with Python 2.

In my local testing, the perf cost was way below the noise threshold.

tk0miya commented 4 years ago

+1