fix: use png for thumbnails

next
timokoesters 2020-05-19 23:50:20 +02:00
parent cf91996336
commit ada260bf42
No known key found for this signature in database
GPG Key ID: 24DA7517711A2BA4
1 changed files with 1 additions and 1 deletions

View File

@ -125,7 +125,7 @@ impl Media {
if let Ok(image) = image::load_from_memory(&file) { if let Ok(image) = image::load_from_memory(&file) {
let thumbnail = image.thumbnail(width, height); let thumbnail = image.thumbnail(width, height);
let mut thumbnail_bytes = Vec::new(); let mut thumbnail_bytes = Vec::new();
thumbnail.write_to(&mut thumbnail_bytes, image::ImageOutputFormat::Jpeg(75))?; thumbnail.write_to(&mut thumbnail_bytes, image::ImageOutputFormat::Png)?;
// Save thumbnail in database so we don't have to generate it again next time // Save thumbnail in database so we don't have to generate it again next time
let mut thumbnail_key = key.to_vec(); let mut thumbnail_key = key.to_vec();