decoder: Detect HEIC/HEIF via guessed mime type
This will not cover files with wrong extensions. But we don't have a magic byte sniffer in place yet. Issue #115
This commit is contained in:
parent
c041dcad3d
commit
65e967c235
1 changed files with 5 additions and 0 deletions
|
|
@ -160,6 +160,11 @@ impl Decoder {
|
|||
if content_type.split('+').next() == Some("image/svg") {
|
||||
update_sender.send(DecoderUpdate::Format(ImageFormat::Svg));
|
||||
return Ok(FormatDecoder::Svg(Svg::new(path, update_sender, tiles)));
|
||||
} else if ["image/avif", "image/heif", "image/heic"]
|
||||
.contains(&content_type.as_str())
|
||||
{
|
||||
update_sender.send(DecoderUpdate::Format(ImageFormat::Heif));
|
||||
return Ok(FormatDecoder::Heif(Heif::new(path, update_sender, tiles)));
|
||||
} else {
|
||||
bail!(i18n_f("Unknown image format: {}", &[content_type.as_str()]));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue