From c329d323fc2cc9ba1c486932556afd8fbd9333cc Mon Sep 17 00:00:00 2001 From: Luciano Sousa Date: Sun, 30 Dec 2018 18:14:49 -0500 Subject: Permit generating variants of TIFF images --- activestorage/test/fixtures/files/racecar.tif | Bin 0 -> 33705838 bytes activestorage/test/models/variant_test.rb | 11 +++++++++++ 2 files changed, 11 insertions(+) create mode 100644 activestorage/test/fixtures/files/racecar.tif (limited to 'activestorage/test') diff --git a/activestorage/test/fixtures/files/racecar.tif b/activestorage/test/fixtures/files/racecar.tif new file mode 100644 index 0000000000..0a11b22896 Binary files /dev/null and b/activestorage/test/fixtures/files/racecar.tif differ diff --git a/activestorage/test/models/variant_test.rb b/activestorage/test/models/variant_test.rb index 012aee3cc9..d98935eb9f 100644 --- a/activestorage/test/models/variant_test.rb +++ b/activestorage/test/models/variant_test.rb @@ -133,6 +133,17 @@ class ActiveStorage::VariantTest < ActiveSupport::TestCase assert_equal 20, image.height end + test "resized variation of TIFF blob" do + blob = create_file_blob(filename: "racecar.tif") + variant = blob.variant(resize: "50x50").processed + assert_match(/racecar\.png/, variant.service_url) + + image = read_image(variant) + assert_equal "PNG", image.type + assert_equal 50, image.width + assert_equal 33, 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