Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Would be nice if Image (and others?) would accept a pathlib.Path instance.
Image
pathlib.Path
from pathlib import Path fpath = Path('/media/bar/Lake_town-home.jpg') with Image(filename=fpath): pass Traceback (most recent call last): File "/home/bar/.virtualenvs/foo/lib/python3.7/site-packages/wand/image.py", line 8762, in save repr(filename)) TypeError: filename must be a string, not PosixPath('/media/bar/Lake_town-home.jpg')
The text was updated successfully, but these errors were encountered:
It should! Or, perhaps, you located an area/method that does not. Could that error message be coming from another code-location then the one you posted? Just tested with Python 3.7 & 3.8 images load fine from PosixPath instances.
PosixPath
Sorry, something went wrong.
you're right, it's save that triggered the traceback.
save
main_img.save(filename=fpath)
Got it. 9d4ca66 should fix it.
Afaik it's not documented anywhere that Path's are accepted..
No branches or pull requests
Would be nice if
Image
(and others?) would accept apathlib.Path
instance.The text was updated successfully, but these errors were encountered: