1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Correct orientation detection

This commit is contained in:
George Claghorn 2018-01-31 16:50:30 -05:00
parent f9b806eaa1
commit 57cc6f4030
2 changed files with 3 additions and 3 deletions

View file

@ -39,7 +39,7 @@ module ActiveStorage
end end
def rotated_image?(image) def rotated_image?(image)
%w[ RightTop LeftBottom ].include?(image["orientation"]) %w[ RightTop LeftBottom ].include?(image["%[orientation]"])
end end
end end
end end

View file

@ -18,8 +18,8 @@ class ActiveStorage::Analyzer::ImageAnalyzerTest < ActiveSupport::TestCase
blob = create_file_blob(filename: "racecar_rotated.jpg", content_type: "image/jpeg") blob = create_file_blob(filename: "racecar_rotated.jpg", content_type: "image/jpeg")
metadata = extract_metadata_from(blob) metadata = extract_metadata_from(blob)
assert_equal 4104, metadata[:width] assert_equal 2736, metadata[:width]
assert_equal 2736, metadata[:height] assert_equal 4104, metadata[:height]
end end
test "analyzing an SVG image without an XML declaration" do test "analyzing an SVG image without an XML declaration" do