Skip to content

Commit 57cc6f4

Browse files
Correct orientation detection
1 parent f9b806e commit 57cc6f4

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

activestorage/lib/active_storage/analyzer/image_analyzer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def read_image
3939
end
4040

4141
def rotated_image?(image)
42-
%w[ RightTop LeftBottom ].include?(image["orientation"])
42+
%w[ RightTop LeftBottom ].include?(image["%[orientation]"])
4343
end
4444
end
4545
end

activestorage/test/analyzer/image_analyzer_test.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class ActiveStorage::Analyzer::ImageAnalyzerTest < ActiveSupport::TestCase
1818
blob = create_file_blob(filename: "racecar_rotated.jpg", content_type: "image/jpeg")
1919
metadata = extract_metadata_from(blob)
2020

21-
assert_equal 4104, metadata[:width]
22-
assert_equal 2736, metadata[:height]
21+
assert_equal 2736, metadata[:width]
22+
assert_equal 4104, metadata[:height]
2323
end
2424

2525
test "analyzing an SVG image without an XML declaration" do

0 commit comments

Comments
 (0)