webp-sh / webp_server_go

Go version of WebP Server. A tool that will serve your JPG/PNG/BMP/SVGs as WebP/AVIF format with compression, on-the-fly.
https://docs.webp.sh
GNU General Public License v3.0
1.79k stars 173 forks source link

Server don't conversions images to jxl format in Firefox Nightly #325

Closed MIKU-N closed 5 months ago

MIKU-N commented 5 months ago

Describe the bug Firefox Nightly can be enabled JPEG XL supported via the image.jxl.enabled flag in about:config in Nightly. But when I test,server don't conversions images to jxl format,why it happend?that is about Minimized Conversion? image

To Reproduce Just use Firefox Nightly,And enabled JPEG XL supported via the image.jxl.enabled flag in about:config

Expected behavior I think if browser can be enabled JPEG XL supported,then the server should provide support.

Screenshots and logs

webp-webp-1  | 
webp-webp-1  |  
webp-webp-1  |          ▌ ▌   ▌  ▛▀▖ ▞▀▖                ▞▀▖
webp-webp-1  |          ▌▖▌▞▀▖▛▀▖▙▄▘ ▚▄ ▞▀▖▙▀▖▌ ▌▞▀▖▙▀▖ ▌▄▖▞▀▖
webp-webp-1  |          ▙▚▌▛▀ ▌ ▌▌   ▖ ▌▛▀ ▌  ▐▐ ▛▀ ▌   ▌ ▌▌ ▌
webp-webp-1  |          ▘ ▘▝▀▘▀▀ ▘   ▝▀ ▝▀▘▘   ▘ ▝▀▘▘   ▝▀ ▝▀
webp-webp-1  | 
webp-webp-1  |          WebP Server Go - v0.11.0
webp-webp-1  |          Developed by WebP Server team. https://github.com/webp-sh
webp-webp-1  | 
webp-webp-1  | Allowed file types as source: [jpg png jpeg bmp gif]
webp-webp-1  | Convert to WebP Enabled: true
webp-webp-1  | Convert to AVIF Enabled: true
webp-webp-1  | Convert to JXL Enabled: true
webp-webp-1  | WebP Server Go is Running on http://0.0.0.0:3333
webp-webp-1  | time="2024-04-09 17:48:16" level=warning msg="can't read metadata: open metadata/local/be7d584b2c1d29a5.json: no such file or directory" func="[38:webp_server_go/helper.ReadMetadata]"
webp-webp-1  | time="2024-04-09 17:48:17" level=info msg="WebP@70%: /opt/pics/piclist/upload/202311141658847.png->/opt/exhaust/local/be7d584b2c1d29a5.webp 2618893->229418 8.76% deflated" func="[284:webp_server_go/encoder.convertLog]"
webp-webp-1  | time="2024-04-09 17:48:23" level=info msg="AVIF@70%: /opt/pics/piclist/upload/202311141658847.png->/opt/exhaust/local/be7d584b2c1d29a5.avif 2618893->156645 5.98% deflated" func="[284:webp_server_go/encoder.convertLog]"
webp-webp-1  | 50.114.xxx.xxx - [2024-04-09 17:48:16] GET /piclist/upload/202311141658847.png 200  Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:126.0) Gecko/20100101 Firefox/126.0
webp-webp-1  | 50.114.xxx.xxx - [2024-04-09 17:49:16] GET /piclist/upload/202311141658847.png 200  Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0

Environment (please complete the following information):

MIKU-N commented 5 months ago

It seems that you have missed the head judgment of image/jxl. https://github.com/webp-sh/webp_server_go/blob/ac306051240925eb6a784fce286c67fe1c3a0caa/helper/helper.go#L124-L175

n0vad3v commented 5 months ago

Should be fixed by https://github.com/webp-sh/webp_server_go/pull/326, you can try using ghcr.io/webp-sh/webp_server_go:master image to see if it works by now.

MIKU-N commented 5 months ago

Should be fixed by #326, you can try using ghcr.io/webp-sh/webp_server_go:master image to see if it works by now.

Now it fixed!Thanks! image