From ae0274c39c7f9d14ad7140662dec06f397ca9089 Mon Sep 17 00:00:00 2001 From: Nova Kwok Date: Wed, 30 Oct 2024 10:13:41 +0800 Subject: [PATCH 1/2] Add iOS 18 support (#360) --- helper/helper.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/helper/helper.go b/helper/helper.go index c4237d2..974d69d 100644 --- a/helper/helper.go +++ b/helper/helper.go @@ -141,7 +141,7 @@ func GuessSupportedFormat(header *fasthttp.RequestHeader) map[string]bool { supported["jxl"] = true } - supportedWebPs := []string{"iPhone OS 14", "CPU OS 14", "iPhone OS 15", "CPU OS 15", "iPhone OS 16", "CPU OS 16", "iPhone OS 17", "CPU OS 17"} + supportedWebPs := []string{"iPhone OS 14", "CPU OS 14", "iPhone OS 15", "CPU OS 15", "iPhone OS 16", "CPU OS 16", "iPhone OS 17", "CPU OS 17", "iPhone OS 18", "CPU OS 18"} for _, version := range supportedWebPs { if strings.Contains(ua, version) { supported["webp"] = true @@ -149,7 +149,7 @@ func GuessSupportedFormat(header *fasthttp.RequestHeader) map[string]bool { } } - supportedAVIFs := []string{"iPhone OS 16", "CPU OS 16", "iPhone OS 17", "CPU OS 17"} + supportedAVIFs := []string{"iPhone OS 16", "CPU OS 16", "iPhone OS 17", "CPU OS 17", "iPhone OS 18", "CPU OS 18"} for _, version := range supportedAVIFs { if strings.Contains(ua, version) { supported["avif"] = true @@ -160,7 +160,7 @@ func GuessSupportedFormat(header *fasthttp.RequestHeader) map[string]bool { // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15 <- iPad // Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3.1 Safari/605.1.15 <- Mac // Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Mobile/15E148 Safari/604.1 <- iPhone @ Safari - supportedJXLs := []string{"iPhone OS 17", "CPU OS 17", "Version/17"} + supportedJXLs := []string{"iPhone OS 17", "CPU OS 17", "Version/17", "iPhone OS 18", "CPU OS 18", "Version/18"} if strings.Contains(ua, "iPhone") || strings.Contains(ua, "Macintosh") { for _, version := range supportedJXLs { if strings.Contains(ua, version) { From a08b6e66aeeb3d83be8b4105982c5861a22b3036 Mon Sep 17 00:00:00 2001 From: Nova Kwok Date: Wed, 13 Nov 2024 22:10:30 +0800 Subject: [PATCH 2/2] Use newer version of libaom (#363) * Use newer version of libaom * Install curl --- Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 44ce5fc..c11c0f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,14 @@ RUN cd /build && sed -i "s|.\/pics|${IMG_PATH}|g" config.json \ FROM debian:bookworm-slim -RUN apt update && apt install --no-install-recommends libvips ca-certificates libjemalloc2 libtcmalloc-minimal4 -y && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt/archives/* +RUN apt update && apt install --no-install-recommends libvips ca-certificates libjemalloc2 libtcmalloc-minimal4 curl -y && rm -rf /var/lib/apt/lists/* && rm -rf /var/cache/apt/archives/* + +# Download and install libam with correct arch +# http://ftp.us.debian.org/debian/pool/main/a/aom/libaom3_3.11.0~rc1-1_amd64.deb +# http://ftp.us.debian.org/debian/pool/main/a/aom/libaom3_3.11.0~rc1-1_arm64.deb +RUN curl -O http://ftp.us.debian.org/debian/pool/main/a/aom/libaom3_3.11.0~rc1-1_$(dpkg --print-architecture).deb && \ + dpkg -i libaom3_3.11.0~rc1-1_$(dpkg --print-architecture).deb && \ + rm libaom3_3.11.0~rc1-1_$(dpkg --print-architecture).deb COPY --from=builder /build/webp-server /usr/bin/webp-server COPY --from=builder /build/config.json /etc/config.json