rokka-io / imagine-vips

libvips adapter for php imagine
https://rokka.io
Other
41 stars 8 forks source link

Issue with loading animated webp #35

Closed andi-wr closed 1 year ago

andi-wr commented 1 year ago

For the loaders VipsForeignLoadWebpFile and VipsForeignLoadWebpBuffer the n-Option is not being applied so no animated webp can be loaded:

https://github.com/rokka-io/imagine-vips/blob/0.31.0/lib/Imagine/Vips/Imagine.php#L237

I think there should also be those two cases:

            case 'VipsForeignLoadWebpFile':
            case 'VipsForeignLoadWebpBuffer':
                $options['n'] = -1; // not sure this should be enabled by default, to discuss
                break;

When I add those lines, i can open animated webp images without any problems. Otherwise only the first frame will be loaded, so the animation will "get lost".

chregu commented 1 year ago

Thanks. Fixed in https://github.com/rokka-io/imagine-vips/commit/b50018802f0b8d4989c642cc93bf1e0e2e5f769b