Skip to content

Commit bd4be49

Browse files
committed
Fix MiniMagic::Image.mime_type deprecation in ASto test
``` [MiniMagick] MiniMagick::Image#mime_type has been deprecated, because it wasn't returning correct result for all formats ImageMagick supports. Unfortunately, returning the correct MIME type would be very slow, because it would require ImageMagick to read the whole file. It's better to use Marcel and MimeMagic gems, which are able to determine the MIME type just from the image header. ``` This method is removed in v5 of `mini_magick` gem: > Removed deprecated Image#mime_type, as it wasn't accurate. > MIME type from file content should be determined either using Marcel > or MimeMagic, or mime-types or MiniMime using Image#type. Since we depend on it through `image_processing` gem (`mini_magick (>= 4.9.5, < 5)`), while work is being done in janko/image_processing#132 so sooner or later this test will fail.
1 parent 1387af8 commit bd4be49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

activestorage/test/previewer/video_previewer_test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class ActiveStorage::Previewer::VideoPreviewerTest < ActiveSupport::TestCase
1616
image = MiniMagick::Image.read(attachable[:io])
1717
assert_equal 640, image.width
1818
assert_equal 480, image.height
19-
assert_equal "image/jpeg", image.mime_type
19+
assert_equal "image/jpeg", Marcel::Magic.by_extension(image.type).type
2020
end
2121
end
2222

0 commit comments

Comments
 (0)