Skip to main content

transcode

Function transcode 

Source
async fn transcode(
    data: Bytes,
    mime: &'static str,
    is_gif: bool,
    is_webp: bool,
) -> (Vec<u8>, String)
Expand description

在阻塞线程中执行转码,避免阻塞 async 运行时。 Bytes clone 廉价(引用计数 +1);join 失败(panic)时回退原格式。