Removed unnecessary dev dependencies
This commit is contained in:
parent
6c1a538162
commit
6099c3fe7c
|
@ -33,10 +33,7 @@ img-parts = "0.2.3"
|
||||||
bytes = "1.1.0"
|
bytes = "1.1.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
dssim = "2.11.2"
|
dssim = "3.1.2"
|
||||||
load_image = { version = "2.12.1", features = ["static"] }
|
|
||||||
imgref = "1.7.0"
|
|
||||||
lodepng = "3.0.0"
|
|
||||||
kamadak-exif = "0.5.0"
|
kamadak-exif = "0.5.0"
|
||||||
|
|
||||||
[lib]
|
[lib]
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
use imgref::{Img, ImgVec};
|
use dssim::Val;
|
||||||
use std::path::Path;
|
|
||||||
use dssim::{RGBAPLU, ToRGBAPLU, Val};
|
|
||||||
use load_image::ImageData;
|
|
||||||
use std::sync::Once;
|
use std::sync::Once;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|
||||||
|
@ -21,24 +18,10 @@ pub fn cleanup(file: &str) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn load<P: AsRef<Path>>(path: P) -> Result<ImgVec<RGBAPLU>, lodepng::Error> {
|
|
||||||
let img = load_image::load_image(path.as_ref(), false)?;
|
|
||||||
match img.bitmap {
|
|
||||||
ImageData::RGB8(ref bitmap) => Ok(Img::new(bitmap.to_rgbaplu(), img.width, img.height)),
|
|
||||||
ImageData::RGB16(ref bitmap) => Ok(Img::new(bitmap.to_rgbaplu(), img.width, img.height)),
|
|
||||||
ImageData::RGBA8(ref bitmap) => Ok(Img::new(bitmap.to_rgbaplu(), img.width, img.height)),
|
|
||||||
ImageData::RGBA16(ref bitmap) => Ok(Img::new(bitmap.to_rgbaplu(), img.width, img.height)),
|
|
||||||
ImageData::GRAY8(ref bitmap) => Ok(Img::new(bitmap.to_rgbaplu(), img.width, img.height)),
|
|
||||||
ImageData::GRAY16(ref bitmap) => Ok(Img::new(bitmap.to_rgbaplu(), img.width, img.height)),
|
|
||||||
ImageData::GRAYA8(ref bitmap) => Ok(Img::new(bitmap.to_rgbaplu(), img.width, img.height)),
|
|
||||||
ImageData::GRAYA16(ref bitmap) => Ok(Img::new(bitmap.to_rgbaplu(), img.width, img.height)),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
fn diff(compressed: &str) -> Val {
|
fn diff(compressed: &str) -> Val {
|
||||||
let attr = dssim::Dssim::new();
|
let attr = dssim::Dssim::new();
|
||||||
let orig = attr.create_image(&load("tests/samples/uncompressed_드림캐쳐.jpg").unwrap()).unwrap();
|
let orig = dssim::load_image(&attr, "tests/samples/uncompressed_드림캐쳐.jpg").unwrap();
|
||||||
let comp = attr.create_image(&load(compressed).unwrap()).unwrap();
|
let comp = dssim::load_image(&attr, compressed).unwrap();
|
||||||
let (diff, _) = attr.compare(&orig, comp);
|
let (diff, _) = attr.compare(&orig, comp);
|
||||||
diff
|
diff
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue