mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
fix: support RGBA16 images (#250)
This commit is contained in:
parent
f4a8b26a5a
commit
baeb009fa0
1 changed files with 6 additions and 1 deletions
|
|
@ -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…
Add table
Reference in a new issue