Skip to content

Comments

Add fallback for 0-dimension images (webp animations)#6342

Merged
WithoutPants merged 1 commit intostashapp:developfrom
OtterBotSociety:fix-gallery-better
Dec 2, 2025
Merged

Add fallback for 0-dimension images (webp animations)#6342
WithoutPants merged 1 commit intostashapp:developfrom
OtterBotSociety:fix-gallery-better

Conversation

@OtterBotSociety
Copy link
Contributor

I'm still running into an issue with animated WebP files. After verifying the output of ffprobe directly (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.

@OtterBotSociety
Copy link
Contributor Author

OtterBotSociety commented Nov 29, 2025

Here's an example 3-frame animated webp image that ffprobe fails to parse (returning 0x0) but DecodeConfig parses successfully (returning 200x150)

Epilepsy warning - example webp animation (flashing colors!)

test_animated_webp_example

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

@WithoutPants WithoutPants added the bug Something isn't working label Dec 2, 2025
@WithoutPants WithoutPants added this to the Version 0.30.0 milestone Dec 2, 2025
@feederbox826
Copy link
Collaborator

not sure if this will catch the actual cause of the edge cases - since webm/p is based on mkv, the dimensions can actually be dynamic 1 2 3

Copy link
Collaborator

@WithoutPants WithoutPants left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm satisfied that this will at least iteratively improve scanning for such files.

@WithoutPants WithoutPants merged commit 5f16547 into stashapp:develop Dec 2, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants