weserv / images

Source code of wsrv.nl (formerly images.weserv.nl), to be used on your own server(s).
https://wsrv.nl/
BSD 3-Clause "New" or "Revised" License
1.97k stars 193 forks source link

Webp animation is overlapping #278

Closed fabian-emilius closed 3 years ago

fabian-emilius commented 3 years ago

The resized image has overlapping frames:

https://images.weserv.nl/?h=370&w=370&fit=inside&we&q=75&output=webp&n=-1&url=https://cloudflare-ipfs.com/ipfs/QmZ2czWvjhiiGoAyL3qSqWN7mSxY5J2ACAmXaPaELodUkh

Original: https://cloudflare-ipfs.com/ipfs/QmZ2czWvjhiiGoAyL3qSqWN7mSxY5J2ACAmXaPaELodUkh

kleisauke commented 3 years ago

It looks like DISPOSE_PREVIOUS is not handled correctly in the GIF loader of libvips 8.10 (which is based upon giflib). libvips master has switched to libnsgif, which handles this image correctly.

fabian-emilius commented 3 years ago

So it will work again if I rebuild the docker image?

kleisauke commented 3 years ago

No, you'll have to wait for libvips 8.11 or build libvips from source within the Docker image.

fabian-emilius commented 3 years ago

Mmh I do not really get it to work properly when compiling from master. Is there any hope that a fix for this is available soon?

kleisauke commented 3 years ago

libvips version 8.11.0-rc1 is now available for testing at Remi's RPM repository (see https://github.com/remicollet/remirepo/issues/171). To test this, this change in the Dockerfile is needed:

--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -36,10 +36,11 @@ RUN dnf install -y epel-release \
     && dnf config-manager --set-enabled remi \
     && dnf install -y --nogpgcheck https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm \
     && rpmkeys --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-free-el-8  \
-    && dnf install -y --setopt=tsflags=nodocs \
+    && dnf install -y --enablerepo=remi-test --setopt=tsflags=nodocs \
         git \
         cmake \
-        vips-full-devel \
+        vips-devel \
+        vips-magick-im6 \
         make \
         gcc \
         gcc-c++ \

fwiw, this new version of libvips has been deployed on April 26th at images.weserv.nl.

kleisauke commented 3 years ago

libvips v8.11.0 has been landed on Remi's RPM repository with commit 0654a74. I've updated the RPM packages names with https://github.com/weserv/images/commit/40cc52cecad6664bbb37dccfad34e2265fb2d492, so a recompilation of the Docker image should automatically pick this up.

You could also use the prebuilt Docker image available on GitHub's Container Registry: https://github.com/orgs/weserv/packages/container/package/images