From bcf370d689673031073ba2ac5588afe41cc315c9 Mon Sep 17 00:00:00 2001 From: Younes SERRAJ Date: Sun, 21 Apr 2019 19:07:22 +0200 Subject: Allow ActiveStorage to generate variants of BMP images --- activestorage/test/models/variant_test.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'activestorage/test/models') diff --git a/activestorage/test/models/variant_test.rb b/activestorage/test/models/variant_test.rb index d98935eb9f..92e3384042 100644 --- a/activestorage/test/models/variant_test.rb +++ b/activestorage/test/models/variant_test.rb @@ -144,6 +144,17 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase assert_equal 33, image.height end + test "resized variation of BMP blob" do + blob = create_file_blob(filename: "colors.bmp") + variant = blob.variant(resize: "15x15").processed + assert_match(/colors\.bmp/, variant.service_url) + + image = read_image(variant) + assert_equal "BMP", image.type + assert_equal 15, image.width + assert_equal 8, image.height + end + test "optimized variation of GIF blob" do blob = create_file_blob(filename: "image.gif", content_type: "image/gif") -- cgit v1.2.3