mirror of
https://github.com/sxyazi/yazi.git
synced 2024-12-18 14:21:32 +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);
|
||||
}
|
||||
|
||||
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)
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user