-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
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
Tile Grid: hevc (Main Still Picture) (hvc1 / 0x31637668), yuvj420p(pc, smpte170m/bt470bg/iec61966-2-1), 1080x1440 (default)这种格式的图片会报错 #151
Comments
这个url用requests.get读取, 出来的内容类型不是"image/xx", 所以有问题: import requests
image_src = 'https://watermarkud.tos-cn-shanghai.volces.com/input/2024/12/24/15/ucK19IiORSf.jpg'
response = requests.get(image_src)
print(response.headers["Content-Type"])
# 'binary/octet-stream' 但其实实质上是因为你这个图像实际上是 参考 https://stackoverflow.com/questions/54395735/how-to-work-with-heic-image-file-types-in-python, 添加 from pillow_heif import register_heif_opener
register_heif_opener() 就可以之后 |
我是用try把那个包起来了,报错就走pillow_heif的写法 |
可以, 但是也没必要?... 因为只是添加 |
已经按照你提供的方法修改了 |
File "/BiRefNet/BiRefNetModel.py", line 38, in inference
image = Image.open(BytesIO(origin_image_bytes)) # 使用BytesIO来处理字节数据
File "/usr/local/lib/python3.10/dist-packages/PIL/Image.py", line 3536, in open
raise UnidentifiedImageError(msg)
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7f56337d2250>
这是我图片的url,
https://watermarkud.tos-cn-shanghai.volces.com/input/2024/12/24/15/ucK19IiORSf.jpg
The text was updated successfully, but these errors were encountered: