IOS如何展示webp格式图片

前提条件:图片服务器是阿里云OSS

问题原因: 安卓端上传了一张webp格式图片 , 安卓手机、chrome 等访问都没问题, 但是 IOS手机、Safari 确访问不了。

解决办法: 

1.确定是否是webp图片 将图片url拼接上字符串?x-oss-process=image/info, 若返回有Format": {"value":"webp"},则可确定是webp格式图片。

例如: https://namecard.oss-cn-beijing.aliyuncs.com/xxx?x-oss-process=image/info 

2.将原图片URL拼接上字符串?x-oss-process=image/format,jpg 就可以访问了。 

例如: https://namecard.oss-cn-beijing.aliyuncs.com/xxx?x-oss-process=image/format,jpg 

3.如果有其他缩放或者裁剪可以这样拼接 ?x-oss-process=image/reisze,w_100/format,jpg 。

例如: https://namecard.oss-cn-beijing.aliyuncs.com/xxx?x-oss-process=image/resize,m_fill,w_28,h_28/format,jpg


参考资料:

https://www.upyun.com/webp

https://help.aliyun.com/document_detail/44703.html

https://blog.csdn.net/u013107634/article/details/88403384

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。