Properly resize images, bump library generation to match.
This commit is contained in:
parent
b801954599
commit
43974b7406
@ -16,7 +16,7 @@ use rocksdb::IteratorMode;
|
||||
use rocksdb::DB;
|
||||
|
||||
// Used to ensure DB is invalidated after schema changes.
|
||||
const LIBRARY_GENERATION: &'static str = "1";
|
||||
const LIBRARY_GENERATION: &'static str = "2";
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct Library {
|
||||
@ -34,6 +34,7 @@ impl Library {
|
||||
cache_db,
|
||||
root,
|
||||
};
|
||||
lib.clean_db()?;
|
||||
if !lib.originals_dir.exists() {
|
||||
info!(
|
||||
"create originals dir {}",
|
||||
@ -163,7 +164,8 @@ impl Library {
|
||||
.decode()
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
|
||||
// TODO (wathiede) resize..fill
|
||||
let img = orig_img.resize(w, h, image::imageops::FilterType::CatmullRom);
|
||||
let img =
|
||||
orig_img.resize_to_fill(w, h, image::imageops::FilterType::CatmullRom);
|
||||
let mut buf = Vec::new();
|
||||
img.write_to(&mut buf, image::ImageFormat::Jpeg)
|
||||
.map_err(|e| io::Error::new(io::ErrorKind::Other, e))?;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user