diff --git a/src/library/types.cr b/src/library/types.cr index a4de007..0545184 100644 --- a/src/library/types.cr +++ b/src/library/types.cr @@ -1,4 +1,12 @@ -SUPPORTED_IMG_TYPES = ["image/jpeg", "image/png", "image/webp"] +SUPPORTED_IMG_TYPES = %w( + image/jpeg + image/png + image/webp + image/apng + image/avif + image/gif + image/svg+xml +) enum SortMethod Auto diff --git a/src/util/util.cr b/src/util/util.cr index c4e168a..bc710bd 100644 --- a/src/util/util.cr +++ b/src/util/util.cr @@ -35,6 +35,11 @@ def register_mime_types # FontAwesome fonts ".woff" => "font/woff", ".woff2" => "font/woff2", + + # Supported image formats. JPG, PNG, GIF, WebP, and SVG are already + # defiend by Crystal in `MIME.DEFAULT_TYPES` + ".apng" => "image/apng", + ".avif" => "image/avif", }.each do |k, v| MIME.register k, v end