Support all image types (resolves #192)

This commit is contained in:
Alex Ling
2021-09-06 13:32:10 +00:00
parent da8a485087
commit f67e4e6cb9
5 changed files with 9 additions and 10 deletions

View File

@@ -120,3 +120,7 @@ class String
match / s.size
end
end
def filename_is_image(fn : String) : Bool
MIME.from_filename?(fn).try(&.starts_with?("image/")) || false
end