don't re-encode webp

This commit is contained in:
Allie Signet 2022-07-01 19:32:18 -03:00
parent f64e309425
commit 32da215841
3 changed files with 10 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View file

@ -55,6 +55,16 @@ fn image_upload<'u>(
ImageFormat::JPG
}
image::ImageFormat::WebP => {
accessor.put(
&db_context.image_store,
data_hash.as_slice(),
&data,
lmdb::put::Flags::empty(),
)?;
ImageFormat::WEBP
}
_ => {
// TODO: allow lossy compression via option
let encoded = webp::Encoder::from_image(&img).unwrap().encode_lossless();