image
image copied to clipboard
Error when decoding unsupported animated webp, instead of panic
This solves a panic that would happen if a frame was not the same height and width as the image info
This solves the following issue: https://github.com/image-rs/image/issues/1775
I license past and future contributions under the dual MIT/Apache-2.0 license, allowing licensees to chose either at their option.
The panic will only happen if the frame dimension size is different from the info dimension size.
I agree. This is a patch to stop a panic, not a rewrite of the underlying problem.
As a user of a rust library a panic is just about the worst case scenario, because there is really nothing you can do to handle it or prevent it.
Another suggestion here is to gracefully return an error instead of a panic. But I opted for the option that will result in a "good enough for now" result, and then we can work on the real solution.
Gracefully returning an error would be a better way towards working to a real solution. Wrong results easily become (improperly) relied upon before they are fixed. The library explicitly has an Unsupported
error variant for these cases. So changing it to return that instead would be appreciated :+1:
An error is returned instead of a panic now. I added a "is_supported" function, but this can ofc be completely removed once the real cause of the problem is solved.
Now that #2148 is merged, this cannot be merged and should be closed I guess?
#1775 is also closed already.