decoder: Bring back support for still WebP images
We manually have to use the static decoder instead of the frames api as for PNG. Issue #115
This commit is contained in:
parent
65e967c235
commit
ca672552be
1 changed files with 10 additions and 4 deletions
|
|
@ -125,10 +125,16 @@ impl ImageRsOther {
|
|||
image_rs::codecs::gif::GifDecoder::new(file)?.into_frames(),
|
||||
ImageFormat::AnimatedGif,
|
||||
),
|
||||
image_rs::ImageFormat::WebP => (
|
||||
image_rs::codecs::webp::WebPDecoder::new(file)?.into_frames(),
|
||||
ImageFormat::AnimatedWebP,
|
||||
),
|
||||
image_rs::ImageFormat::WebP => {
|
||||
let decoder = image_rs::codecs::webp::WebPDecoder::new(file)?;
|
||||
if decoder.has_animation() {
|
||||
(decoder.into_frames(), ImageFormat::AnimatedWebP)
|
||||
} else {
|
||||
// Static WebP images need a different decoder
|
||||
Self::new_static(path, format, updater, tiles);
|
||||
return Ok(());
|
||||
}
|
||||
}
|
||||
image_rs::ImageFormat::Png => {
|
||||
let decoder = image_rs::codecs::png::PngDecoder::new(file)?;
|
||||
if decoder.is_apng() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue