mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Merge pull request #36051 from yoones/active-storage-bmp-variants-support
Allow ActiveStorage to generate variants of BMP images
This commit is contained in:
commit
142a8b97ef
4 changed files with 17 additions and 0 deletions
|
@ -1,3 +1,7 @@
|
|||
* Permit generating variants of BMP images.
|
||||
|
||||
*Younes Serraj*
|
||||
|
||||
## Rails 6.0.0.beta3 (March 11, 2019) ##
|
||||
|
||||
* No changes.
|
||||
|
|
|
@ -33,6 +33,7 @@ module ActiveStorage
|
|||
image/jpeg
|
||||
image/pjpeg
|
||||
image/tiff
|
||||
image/bmp
|
||||
image/vnd.adobe.photoshop
|
||||
image/vnd.microsoft.icon
|
||||
)
|
||||
|
@ -56,6 +57,7 @@ module ActiveStorage
|
|||
image/jpg
|
||||
image/jpeg
|
||||
image/tiff
|
||||
image/bmp
|
||||
image/vnd.adobe.photoshop
|
||||
image/vnd.microsoft.icon
|
||||
application/pdf
|
||||
|
|
BIN
activestorage/test/fixtures/files/colors.bmp
vendored
Normal file
BIN
activestorage/test/fixtures/files/colors.bmp
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.7 KiB |
|
@ -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")
|
||||
|
||||
|
|
Loading…
Reference in a new issue