onevcat / Kingfisher

A lightweight, pure-Swift library for downloading and caching images from the web.
MIT License
23.43k stars 2.66k forks source link

部分jpg图片链接无法显示的问题,kf.setImage(with: URL(string: url), placeholder: placeholder) #2213

Open sunjianios opened 9 months ago

sunjianios commented 9 months ago

xcode 15.2 Kingfisher (7.9.1)

可以显示的图片:https://lechangecloud.oss-cn-hangzhou.aliyuncs.com/lechange/snappic/9F0EB79PAJ546FD_img/Alarm/44/6394760186c44509b19e25f4a729f691.jpg?Expires=1709099268&OSSAccessKeyId=LTAIP4igXeEjYBoG&Signature=h1A789p%2Bu%2FX%2BuMYjnbgAwKpylSA%3D"

无法显示的图片:"channelPicUrl":"https://lechangecloud.oss-cn-hangzhou.aliyuncs.com/lechange/snappic/9F0EB79PAJ546FD_img/Alarm/51/06ea173ded834dc19a30c77eda5f76c1.jpg?Expires=1709099272&OSSAccessKeyId=LTAIP4igXeEjYBoG&Signature=6J3YtLqaFblHO0e9BbdTnhPeBNI%3D"

补充: mac浏览器加载上述两个地址,会先后两张图片,第二张图片使用预览也无法打开,查看简介发现可能是图片缺少:尺寸、色彩空间、颜色描述文件这几个元素。

图片

请教各位大神代码层面有啥解决的方案吗?

sunjianios commented 9 months ago

SDWebImage and Kingfisher have the same issue. 😂, https://github.com/SDWebImage/SDWebImage/issues/3675

sunjianios commented 9 months ago

归档.zip

sunjianios commented 9 months ago

Both Safari and Chome cannot display this image on iPhone (06ea173ded834dc19a30c77eda5f76c1)

onevcat commented 9 months ago

This triggers an error

CGImageSourceCreateImageAtIndex:4434: *** ERROR: CGImageSourceCreateImageAtIndex[0] - 'JPEG' - failed to create image [0]

inside Apple's framework. So I would suggest you can try to open a radar (using the Feedback.app) to report it to Apple and only they can fix it. :[

sunjianios commented 9 months ago

thanks