[Bug Report]: Animated webp images partially supported - behave strangely #2555

Closed
opened 2026-02-05 04:29:40 +03:00 by OVERLORD · 5 comments
Owner

Originally created by @paviro on GitHub (Jan 4, 2022).

Describe the Bug

When I noticed #3136 I tried a couple of other animated image formats one of them webp.
When uploading a normal webp image everything is fine. When containing animations however the image uploads just fine but doesn't show a preview.
jkdfjdf
When adding the image to the document it is displayed like you can see in the background. Clicking on it show the source to be null.
jksjkdsjkfsdf
Removing the image and adding it again has the same result. Clicking on the folder on the existing image with the null resource and adding it from here results in this:
sjkdjksdjkds
The question mark image can be removed and the animated webp stays in tackt now but only if you add it this way.

Steps to Reproduce

See above.

Expected Behaviour

Animated webp images should behave as normal webp images do.

Screenshots or Additional Context

No response

Exact BookStack Version

BookStack v21.12

PHP Version

8.0

Hosting Environment

Debian with Nginx as webserver

Originally created by @paviro on GitHub (Jan 4, 2022). ### Describe the Bug When I noticed #3136 I tried a couple of other animated image formats one of them webp. When uploading a normal webp image everything is fine. When containing animations however the image uploads just fine but doesn't show a preview. <img width="1195" alt="jkdfjdf" src="https://user-images.githubusercontent.com/992826/148083534-b3d9a38c-4436-41d4-b537-6b0e19c362f1.png"> When adding the image to the document it is displayed like you can see in the background. Clicking on it show the source to be null. <img width="1165" alt="jksjkdsjkfsdf" src="https://user-images.githubusercontent.com/992826/148083737-bdf48700-eb39-417d-9a30-2ab170eb3c1d.png"> Removing the image and adding it again has the same result. Clicking on the folder on the existing image with the null resource and adding it from here results in this: <img width="817" alt="sjkdjksdjkds" src="https://user-images.githubusercontent.com/992826/148084060-459054ad-f0c5-4b94-b03b-89e1d6a8dc94.png"> The question mark image can be removed and the animated webp stays in tackt now but only if you add it this way. ### Steps to Reproduce See above. ### Expected Behaviour Animated webp images should behave as normal webp images do. ### Screenshots or Additional Context _No response_ ### Exact BookStack Version BookStack v21.12 ### PHP Version 8.0 ### Hosting Environment Debian with Nginx as webserver
OVERLORD added the 🐛 Bug label 2026-02-05 04:29:40 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jan 7, 2022):

Just checked this out, Appears to be more complicated than GIF or APNG.

Animated webp is not supported by libgd, so we cannot currently create thumbnails for these where required. They are uploaded but their gallery thumbnail will be missing as shown and since their display size is not generated they are added to a page with issue. imagemagick may support these images but don't want to swap out the image driver just because of this case.

Maybe we change the page implementation to use the original file link if no thumbnails exist, Not sure about the gallery though, I don't want to be loading in full image versions. Might just need to have a better placeholder.

@ssddanbrown commented on GitHub (Jan 7, 2022): Just checked this out, Appears to be more complicated than GIF or APNG. Animated webp is not supported by libgd, so we cannot currently create thumbnails for these where required. They are uploaded but their gallery thumbnail will be missing as shown and since their display size is not generated they are added to a page with issue. imagemagick may support these images but don't want to swap out the image driver just because of this case. Maybe we change the page implementation to use the original file link if no thumbnails exist, Not sure about the gallery though, I don't want to be loading in full image versions. Might just need to have a better placeholder.
Author
Owner

@paviro commented on GitHub (Jan 7, 2022):

Maybe a note when you upload one saying that it isn’t supported at the moment (until libgd supports it) is the best solution?

@paviro commented on GitHub (Jan 7, 2022): Maybe a note when you upload one saying that it isn’t supported at the moment (until libgd supports it) is the best solution?
Author
Owner

@ssddanbrown commented on GitHub (Jan 7, 2022):

Maybe, but to do that we'd need to sniff out if it's an animated webp image before storing, which produces another single-purpose edge-case in the logic. The above could apply for any scenarios where we can't produce thumbnails.

@ssddanbrown commented on GitHub (Jan 7, 2022): Maybe, but to do that we'd need to sniff out if it's an animated webp image before storing, which produces another single-purpose edge-case in the logic. The above could apply for any scenarios where we can't produce thumbnails.
Author
Owner

@ssddanbrown commented on GitHub (Jan 10, 2022):

I've now applied 941217d9fb which will do as per my comment above (Improved gallery backup placeholder in addition to using original image url in editors if display thumbnail does not exist). Have tested with animated webp and it seems to do the job, allows usage where desired without harsh breaking although no thumbnail shown in gallery. Think this is a suitable middle ground.

This will be part of the next patch release. Will therefore close this off. Thanks again @paviro for reporting.

@ssddanbrown commented on GitHub (Jan 10, 2022): I've now applied 941217d9fb223e9c5d22d57b2214d48982594823 which will do as per my comment above (Improved gallery backup placeholder in addition to using original image url in editors if display thumbnail does not exist). Have tested with animated webp and it seems to do the job, allows usage where desired without harsh breaking although no thumbnail shown in gallery. Think this is a suitable middle ground. This will be part of the next patch release. Will therefore close this off. Thanks again @paviro for reporting.
Author
Owner

@paviro commented on GitHub (Jan 10, 2022):

Sounds good, thank you!

@paviro commented on GitHub (Jan 10, 2022): Sounds good, thank you!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#2555