don't re-encode webp
This commit is contained in:
parent
f64e309425
commit
32da215841
BIN
db/data.mdb
BIN
db/data.mdb
Binary file not shown.
BIN
db/lock.mdb
BIN
db/lock.mdb
Binary file not shown.
|
@ -55,6 +55,16 @@ fn image_upload<'u>(
|
||||||
|
|
||||||
ImageFormat::JPG
|
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
|
// TODO: allow lossy compression via option
|
||||||
let encoded = webp::Encoder::from_image(&img).unwrap().encode_lossless();
|
let encoded = webp::Encoder::from_image(&img).unwrap().encode_lossless();
|
||||||
|
|
Loading…
Reference in a new issue