fix: guess image format before decoding
This commit is contained in:
parent
861e4f4075
commit
e2444ab697
2 changed files with 4 additions and 2 deletions
|
|
@ -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?
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue