1
This commit is contained in:
@@ -1154,7 +1154,9 @@ async fn download_generated_image(
|
||||
})
|
||||
}
|
||||
|
||||
fn try_apply_background_alpha_to_png(source: &[u8]) -> Option<Vec<u8>> {
|
||||
/// 统一的 PNG 透明背景后处理入口。
|
||||
/// 目前 RPG 角色主图与其他需要“角色主图口径透明背景”的图片资产都复用这套逻辑。
|
||||
pub(crate) fn try_apply_background_alpha_to_png(source: &[u8]) -> Option<Vec<u8>> {
|
||||
let mut image = image::load_from_memory_with_format(source, ImageFormat::Png)
|
||||
.ok()?
|
||||
.to_rgba8();
|
||||
|
||||
Reference in New Issue
Block a user