fix: guess image format before decoding

This commit is contained in:
Ashley Wulber 2024-05-15 13:34:04 -04:00 committed by Jeremy Soller
parent 861e4f4075
commit e2444ab697
2 changed files with 4 additions and 2 deletions

View file

@ -2407,7 +2407,9 @@ impl Tab {
|mut output| async move {
let (path, thumbnail) = tokio::task::spawn_blocking(move || {
let start = std::time::Instant::now();
let thumbnail = match image::io::Reader::open(&path) {
let thumbnail = match image::io::Reader::open(&path)
.and_then(|img| img.with_guessed_format())
{
Ok(reader) => match reader.decode() {
Ok(image) => {
//TODO: configurable thumbnail size?