问题
The file exists, path is correct, however I cannot load the .tif file. Please send help? Here's the code ..
import os
from PIL import Image
name = 'PE-0D8-4m-10s-0001_00009_bbo.tif'
THIS_FOLDER = os.path.dirname(os.path.abspath(__file__))
filename = os.path.join(THIS_FOLDER, name)
image = Image.open(filename)
And here's the traceback:
Traceback (most recent call last):
File "C:\Users\owner\MATLAB Drive\Python\imageload.py", line 23, in <module>
image = Image.open(filename)
File "C:\Users\owner\Anaconda3\envs\spyder\lib\site-packages\PIL\Image.py", line 2862, in open
"cannot identify image file %r" % (filename if filename else fp)
UnidentifiedImageError: cannot identify image file 'C:\\Users\\owner\\MATLAB Drive\\Python\\PE-0D8-4m-10s-0001_00009_bbo.tif'
来源:https://stackoverflow.com/questions/60860654/cannot-open-tif-file-due-to-cannot-identify-image-file-error