mirror of
https://github.com/hkalexling/Mango.git
synced 2025-08-03 11:25:29 -04:00
Support additional image formats:
- APNG - AVIF - GIF - SVG
This commit is contained in:
parent
d9adb49c27
commit
371796cce9
@ -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
|
enum SortMethod
|
||||||
Auto
|
Auto
|
||||||
|
@ -35,6 +35,11 @@ def register_mime_types
|
|||||||
# FontAwesome fonts
|
# FontAwesome fonts
|
||||||
".woff" => "font/woff",
|
".woff" => "font/woff",
|
||||||
".woff2" => "font/woff2",
|
".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|
|
}.each do |k, v|
|
||||||
MIME.register k, v
|
MIME.register k, v
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user