Skip to content

Commit

Permalink
Support guessing AVIF image generated by this library (#2408)
Browse files Browse the repository at this point in the history
  • Loading branch information
neckaros authored Jan 27, 2025
1 parent a7af546 commit 1d64ce6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/image_reader/free_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ pub(crate) fn write_buffer_impl<W: std::io::Write + Seek>(
}
}

static MAGIC_BYTES: [(&[u8], ImageFormat); 25] = [
static MAGIC_BYTES: [(&[u8], ImageFormat); 26] = [
(b"\x89PNG\r\n\x1a\n", ImageFormat::Png),
(&[0xff, 0xd8, 0xff], ImageFormat::Jpeg),
(b"GIF89a", ImageFormat::Gif),
Expand All @@ -146,6 +146,7 @@ static MAGIC_BYTES: [(&[u8], ImageFormat); 25] = [
(b"farbfeld", ImageFormat::Farbfeld),
(b"\0\0\0 ftypavif", ImageFormat::Avif),
(b"\0\0\0\x1cftypavif", ImageFormat::Avif),
(b"\0\0\0\x18ftypavif", ImageFormat::Avif),
(&[0x76, 0x2f, 0x31, 0x01], ImageFormat::OpenExr), // = &exr::meta::magic_number::BYTES
(b"qoif", ImageFormat::Qoi),
(&[0x0a, 0x02], ImageFormat::Pcx),
Expand Down

0 comments on commit 1d64ce6

Please sign in to comment.