diff --git a/src/library.rs b/src/library.rs index f3d7323..40c52d8 100644 --- a/src/library.rs +++ b/src/library.rs @@ -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))?;