Skip to content

Commit

Permalink
Image web avif (#3)
Browse files Browse the repository at this point in the history
* Add webp Mime type

Fixes hyperium#123

* Add AVIF Mime type

---------

Co-authored-by: est31 <[email protected]>
  • Loading branch information
PlamenHristov and est31 authored Jun 5, 2024
1 parent ab7997d commit 044c396
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions mime-parse/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,12 @@ impl Atoms {
if sub == JPEG {
return Atoms::IMAGE_JPEG;
}
if sub == WEBP {
return Atoms::IMAGE_WEBP;
}
if sub == AVIF {
return Atoms::IMAGE_AVIF;
}
},
7 => {
if sub == SVG {
Expand Down Expand Up @@ -444,6 +450,8 @@ names! {
BMP, "bmp";
GIF, "gif";
JPEG, "jpeg";
WEBP, "webp";
AVIF, "avif";
PNG, "png";
SVG, "svg+xml";

Expand Down Expand Up @@ -479,6 +487,8 @@ mimes! {
IMAGE_GIF, "image/gif", 5;
IMAGE_PNG, "image/png", 5;
IMAGE_BMP, "image/bmp", 5;
IMAGE_WEBP, "image/webp", 5;
IMAGE_AVIF, "image/avif", 5;
IMAGE_SVG, "image/svg+xml", 5, Some(9);

FONT_WOFF, "font/woff", 4;
Expand Down
2 changes: 2 additions & 0 deletions src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ mimes! {
IMAGE_GIF, "image/gif";
IMAGE_PNG, "image/png";
IMAGE_BMP, "image/bmp";
IMAGE_WEBP, "image/webp";
IMAGE_AVIF, "image/avif";
IMAGE_SVG, "image/svg+xml";

FONT_WOFF, "font/woff";
Expand Down

0 comments on commit 044c396

Please sign in to comment.