Skip to content

【Feature】后缀名控制自动转webp的数据 #12

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

Open
carolcoral opened this issue Jul 31, 2024 · 6 comments
Open

【Feature】后缀名控制自动转webp的数据 #12

carolcoral opened this issue Jul 31, 2024 · 6 comments
Labels
enhancement New feature request

Comments

@carolcoral
Copy link

carolcoral commented Jul 31, 2024

目前我上传的svg图片也被自动代理了,但是代理后无法正确返回数据,是一个黑色的内容。
能否增加功能和设置用于控制想要自动代理转换的数据,例如设置只允许后缀名为 .png.jpg.jpeg 这些数据自动代理到webp.se上

代理后效果:https://f651bbd.webp.ee/upload/CarbonImageCopy.svg
期望效果:https://oyiso.xindu.site/upload/CarbonImageCopy.svg

@ruibaby ruibaby added the enhancement New feature request label Aug 6, 2024
@Chen017
Copy link

Chen017 commented Feb 21, 2025

+1

@n0vad3v
Copy link
Member

n0vad3v commented Feb 22, 2025

@carolcoral @Chen017
抱歉我们隔了这么久才回复,感谢反馈这个问题,我们发现是一个 Worker 节点使用了旧镜像导致的,目前 SVG 图像会被跳过处理,我们已经手动清理了 https://f651bbd.webp.ee/ 的缓存,目前已经恢复正常。
@Chen017 请手动清理一下 Proxy 的缓存并检查是否已经恢复正常。

@JohnNiang
Copy link
Contributor

SVG 图片已经能够正常输出了,请看下面的输出:

❯ https https://f651bbd.webp.ee/upload/CarbonImageCopy.svg
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
CF-RAY: 915bb932dccdef2b-LHR
Cf-Cache-Status: DYNAMIC
Connection: keep-alive
Content-Encoding: br
Content-Type: image/svg+xml
Date: Sat, 22 Feb 2025 03:00:01 GMT
Etag: W/"520-7E7A6855"
Last-Modified: Sat, 22 Feb 2025 02:28:39 GMT
Server: cloudflare
Transfer-Encoding: chunked
X-Powered-By: WebP Cloud Services (NUE)
X-Webpcloud-Cache: Dynamic
X-Webpcloud-Cost: 0
X-Webpcloud-Fetch-Cost: 0
alt-svc: h3=":443"; ma=86400

<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
  <path fill="currentColor" d="M4 22H2V4a2 2 0 0 1 2-2h18v2H4zm17-5a3 3 0 1 0-3-3a3.003 3.003 0 0 0 3 3m0-4a1 1 0 1 1-1 1a1 1 0 0 1 1-1"/>
  <path fill="currentColor" d="M28 7H9a2.003 2.003 0 0 0-2 2v19a2.003 2.003 0 0 0 2 2h19a2.003 2.003 0 0 0 2-2V9a2.003 2.003 0 0 0-2-2m0 21H9v-6l4-3.997l5.586 5.586a2 2 0 0 0 2.828 0L23 22.003L28 27Zm0-3.828l-3.586-3.586a2 2 0 0 0-2.828 0L20 22.172l-5.586-5.586a2 2 0 0 0-2.828 0L9 19.172V9h19Z"/>
</svg>

@Chen017
Copy link

Chen017 commented Feb 23, 2025

@n0vad3v 好的感谢 但是我不知道为什么 这个插件对我的网站有两个问题 网站 www.etalib.space
第一个 首页的文章封面图的逻辑是 先加载一个gif加载动画 直到封面图片加载完成. 但是当我开启这个插件 gif动画一直重复播放 无法加载出封面图

Image

第二个 这个插件只对文章内的大图生效 也就是说 当我点开一篇文章 缩略图使用的仍然是服务器的图片链接 而当我点开文章图片 才会加载代理的webp链接
(我在webp的dashboard把图片质量调低了 以此区分 可以发现缩略图比大图还清楚 所以缩略图没有使用webp代理)
我的主题没有对缩略图做任何操作 也没有配置图片缩略图生成的拓展配置
缩略图:
Image
大图:
Image

@n0vad3v
Copy link
Member

n0vad3v commented Feb 24, 2025

@Chen017 看上去这个问题和 Halo 插件有关了,可能需要 @JohnNiang 帮忙看看了 😇

@JohnNiang
Copy link
Contributor

Hi @Chen017 ,建议提交新的 Issue 讨论新的问题,尽量不在当前 Issue 下讨论无关的问题。

A1:我这里实际访问发现,所有的图片都会正常加载,只是需要等待一段时间。
A2:参考 #20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature request
Projects
None yet
Development

No branches or pull requests

5 participants