FEATURE: Add support for AVIF images (#21680)

This commit is contained in:
Rafael dos Santos Silva
2023-05-24 16:13:36 -03:00
committed by GitHub
parent f3f841a018
commit baa5389a23
7 changed files with 18 additions and 16 deletions
+1 -1
View File
@@ -158,7 +158,7 @@ class FileHelper
end
def self.supported_images
@@supported_images ||= Set.new %w[jpg jpeg png gif svg ico webp]
@@supported_images ||= Set.new %w[jpg jpeg png gif svg ico webp avif]
end
def self.inline_images
+1 -1
View File
@@ -662,7 +662,7 @@ class UploadCreator
if is_animated != nil
# FastImage will return nil if it cannot determine if animated
is_animated
elsif type == "gif" || type == "webp"
elsif %w[gif webp avif].include?(type)
# Only GIFs, WEBPs and a few other unsupported image types can be animated
OptimizedImage.ensure_safe_paths!(@file.path)