I am dealing with an issue on the Image.open()
function from PIL
in Python.
I try to open an image from a path / folder saved on a string:
path_and_filename = "c:\tmp\test.jpeg"
image = Image.open(path_and_filename)
Then I get the error:
fp = builtins.open(filename, "rb")
PermissionError: [Errno 13] Permission denied: 'c:\\tmp\\test.jpeg'
If I define the path and filename as a raw string, it works:
path_and_filename = r"c:\tmp\test.jpeg"
image = Image.open(path_and_filename)
The error message regarding "permission" makes no sense, since it works on the same file if it is definied as a raw string.
Do you see any solution or recommendetation for this issue?
Thanks a lot!