mirror of
https://github.com/sxyazi/yazi.git
synced 2024-12-19 23:01:36 +03:00
fix: support RGBA16 images (#250)
This commit is contained in:
parent
f4a8b26a5a
commit
baeb009fa0
@ -40,7 +40,12 @@ impl Image {
|
|||||||
return Ok(false);
|
return Ok(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
img.resize(w, h, FilterType::Triangle).save_with_format(cache, ImageFormat::Jpeg)?;
|
match img.resize(w, h, FilterType::Triangle) {
|
||||||
|
DynamicImage::ImageRgb8(buf) => buf.save_with_format(cache, ImageFormat::Jpeg),
|
||||||
|
DynamicImage::ImageRgba8(buf) => buf.save_with_format(cache, ImageFormat::Jpeg),
|
||||||
|
buf => buf.to_rgb8().save_with_format(cache, ImageFormat::Jpeg),
|
||||||
|
}?;
|
||||||
|
|
||||||
Ok(true)
|
Ok(true)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user