Open SludgePhD opened 2 weeks ago
I believe this to be a regression introduced in 0.25
.
My code using 0.24
plays the image fine (also tested using this repo's tests/images/webp/extended_images/anim.webp
), albeit the has_animation
method returns false
.
After update to 0.25
(wrapping the bytes in Cursor
instead of passing them as &[u8]
) I cannot play my test webp nor the one I mentioned above. As mentioned in the issue description, collect_frames
runs into
Format error decoding WebP: No more frames
Although ironically, after the update, the has_animation
method now returns correctly true
.
~This commit breaks the webp animation loader.~
EDIT: That's impossible, probably some caching issue when I was bisecting the culprit commit. Going to try again
This issue is actually quite straightforward. The iterator now returns an error if there are no more frames instead of None
.
decoder
.into_frames()
.take_while(|frame| frame.is_ok())
.collect()
Collecting the frames manually this way works. I will send an MR with a suggested fix as I believe NoMoreFrames
should be caught in the iterator and converted to None
.
WebPDecoder
fails to decode WebP animations.Expected
It should probably work?
Actual behaviour
piston.webp
from the zip archive below) that works fine in Firefox and Chromium results inUnexpectedEof
("failed to fill whole buffer")image-webp
test suite fail with "Format error decoding WebP: No more frames: No more frames"Reproduction steps
WebPDecoder::new(BufReader::new(File::open(path)?))?.into_frames().collect_frames()?
piston.zip