Add fallback for 0-dimension images (webp animations)#6342
Merged
WithoutPants merged 1 commit intostashapp:developfrom Dec 2, 2025
Merged
Add fallback for 0-dimension images (webp animations)#6342WithoutPants merged 1 commit intostashapp:developfrom
WithoutPants merged 1 commit intostashapp:developfrom
Conversation
Contributor
Author
|
Here's an example 3-frame animated webp image that ffprobe fails to parse (returning 0x0) but DecodeConfig parses successfully (returning 200x150) You can recreate this image with imagemagick and libwebp-dev: convert -size 200x150 -background red -fill white -gravity center -pointsize 40 label:"1" frame1.png
convert -size 200x150 -background green -fill white -gravity center -pointsize 40 label:"2" frame2.png
convert -size 200x150 -background blue -fill white -gravity center -pointsize 40 label:"3" frame3.png
img2webp -lossy -d 100 -loop 0 frame*.png -o test_animated.webp |
Collaborator
WithoutPants
approved these changes
Dec 2, 2025
Collaborator
WithoutPants
left a comment
There was a problem hiding this comment.
I'm satisfied that this will at least iteratively improve scanning for such files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

I'm still running into an issue with animated WebP files. After verifying the output of
ffprobedirectly (on various versions from 5.0 up through 8.0), I've determined there isn't an FFMpeg-side fix. Certain WebP animations are still being detected with a width/height of 0, which (just like in my earlier PR) causes the gallery view to fail.Please adjust anything needed to align better with the project's coding conventions. Specifically, I'm not fully certain whether this is the best approach for delegating to the fallback decoder or if it would be cleaner to directly
return decorateFallback(...), among other possibilities.