diff options
author | George Claghorn <george@basecamp.com> | 2018-01-31 16:50:30 -0500 |
---|---|---|
committer | George Claghorn <george@basecamp.com> | 2018-01-31 16:50:30 -0500 |
commit | 57cc6f40309f919dfb30fe63f6d663f6ccaf7856 (patch) | |
tree | 23a605d074d6d44b8af4049654f6414dc9ffd7a5 | |
parent | f9b806eaa18c7bdaedb36a073a450f5fa6417d2e (diff) | |
download | rails-57cc6f40309f919dfb30fe63f6d663f6ccaf7856.tar.gz rails-57cc6f40309f919dfb30fe63f6d663f6ccaf7856.tar.bz2 rails-57cc6f40309f919dfb30fe63f6d663f6ccaf7856.zip |
Correct orientation detection
-rw-r--r-- | activestorage/lib/active_storage/analyzer/image_analyzer.rb | 2 | ||||
-rw-r--r-- | activestorage/test/analyzer/image_analyzer_test.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activestorage/lib/active_storage/analyzer/image_analyzer.rb b/activestorage/lib/active_storage/analyzer/image_analyzer.rb index 7342178eff..3b39de91be 100644 --- a/activestorage/lib/active_storage/analyzer/image_analyzer.rb +++ b/activestorage/lib/active_storage/analyzer/image_analyzer.rb @@ -39,7 +39,7 @@ module ActiveStorage end def rotated_image?(image) - %w[ RightTop LeftBottom ].include?(image["orientation"]) + %w[ RightTop LeftBottom ].include?(image["%[orientation]"]) end end end diff --git a/activestorage/test/analyzer/image_analyzer_test.rb b/activestorage/test/analyzer/image_analyzer_test.rb index f04ed63c3c..f8a38f001a 100644 --- a/activestorage/test/analyzer/image_analyzer_test.rb +++ b/activestorage/test/analyzer/image_analyzer_test.rb @@ -18,8 +18,8 @@ class ActiveStorage::Analyzer::ImageAnalyzerTest < ActiveSupport::TestCase blob = create_file_blob(filename: "racecar_rotated.jpg", content_type: "image/jpeg") metadata = extract_metadata_from(blob) - assert_equal 4104, metadata[:width] - assert_equal 2736, metadata[:height] + assert_equal 2736, metadata[:width] + assert_equal 4104, metadata[:height] end test "analyzing an SVG image without an XML declaration" do |