Cannot open .tif file due to 'cannot identify image file' error

一世执手 提交于 2021-02-11 14:56:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!