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:
parent
f9b806eaa1
commit
57cc6f4030
2 changed files with 3 additions and 3 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue