From d0d4a5a3444665ef48b4e9461c80bf02baeae918 Mon Sep 17 00:00:00 2001 From: Stephen Solis Date: Mon, 28 Mar 2022 09:12:09 -0500 Subject: [PATCH] Fix a file extension issue in Metadata#read_image --- lib/active_storage_validations/metadata.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/active_storage_validations/metadata.rb b/lib/active_storage_validations/metadata.rb index 28b2aea1..ac7131e6 100644 --- a/lib/active_storage_validations/metadata.rb +++ b/lib/active_storage_validations/metadata.rb @@ -55,13 +55,13 @@ def read_image tempfile.flush tempfile.rewind - image = if image_processor == :vips && Vips::get_suffixes.include?(File.extname(tempfile.path)) + image = if image_processor == :vips && Vips::get_suffixes.include?(File.extname(tempfile.path).downcase) Vips::Image.new_from_file(tempfile.path) else MiniMagick::Image.new(tempfile.path) end else - image = if image_processor == :vips && Vips::get_suffixes.include?(File.extname(read_file_path)) + image = if image_processor == :vips && Vips::get_suffixes.include?(File.extname(read_file_path).downcase) Vips::Image.new_from_file(read_file_path) else MiniMagick::Image.new(read_file_path)