This commit is contained in:
Antoine Gersant 2018-10-08 21:28:05 -07:00
parent 120ee72e1d
commit d894ae2783
2 changed files with 4 additions and 3 deletions

View file

@ -476,7 +476,9 @@ fn test_preferences_read_write() {
};
amend(&db, &initial_config).unwrap();
let new_preferences = Preferences {};
let new_preferences = Preferences {
lastfm_username: None,
};
write_preferences(&db, "Teddy🐻", &new_preferences).unwrap();
let read_preferences = read_preferences(&db, "Teddy🐻").unwrap();

View file

@ -41,7 +41,7 @@ pub fn get_thumbnail(real_path: &Path, max_dimension: u32) -> Result<PathBuf> {
out_path.push(format!("{}.jpg", hash.to_string()));
if !out_path.exists() {
let quality = 95;
let quality = 80;
let source_aspect_ratio: f32 = source_width as f32 / source_height as f32;
let mut final_image;
@ -62,7 +62,6 @@ pub fn get_thumbnail(real_path: &Path, max_dimension: u32) -> Result<PathBuf> {
(out_dimension - scaled_width) / 2,
(out_dimension - scaled_height) / 2,
);
final_image.write_to(&mut out_file, ImageOutputFormat::JPEG(quality))?;
} else {
final_image =
source_image.resize_exact(out_dimension, out_dimension, FilterType::Lanczos3);