webp是谷歌提供的有损压缩与无损压缩的图片格式,能大幅度降低图片压缩比例同时不丢失图片的清晰度。至于兼容性,主流的浏览器基本都支持。typecho目前还不支持webp的图片格式,如果上传系统会认为是文件格式而不是一张图片,插入文章最终会呈现出链接的形式。

目前可以通过修改代码的格式,添加对图片的处理。

webp

PLAINTEXT
return preg_match("/screenshot\.(jpg|png|gif|bmp|jpeg|webp)$/i", $path);
点击展开查看更多

webp

PLAINTEXT
$value['attachment']->isImage = in_array($content['type'], array('jpg', 'jpeg', 'gif', 'png', 'tiff', 'bmp', 'webp'));
点击展开查看更多

webp

版权声明

作者: JunYan`Blog

链接: https://www.jinjun.top/posts/dd43/

许可证: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

评论

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键