Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'master' of https://github.com/mbj/mini_magick

  • Loading branch information...
commit 4ac789b9008a9efe6e31f3988c8504861871cdb0 2 parents ea0bb60 + a24f7a4
@hcatlin hcatlin authored
Showing with 4 additions and 0 deletions.
  1. +3 −0  lib/mini_magick.rb
  2. +1 −0  test/image_test.rb
View
3  lib/mini_magick.rb
@@ -156,6 +156,7 @@ def valid?
# image["format"] #=> "TIFF"
# image["height"] #=> 41 (pixels)
# image["width"] #=> 50 (pixels)
+ # image["colorspace"] #=> "DirectClassRGB"
# image["dimensions"] #=> [50, 41]
# image["size"] #=> 2050 (bits)
# image["original_at"] #=> 2005-02-23 23:17:24 +0000 (Read from Exif data)
@@ -167,6 +168,8 @@ def valid?
def [](value)
# Why do I go to the trouble of putting in newlines? Because otherwise animated gifs screw everything up
case value.to_s
+ when "colorspace"
+ run_command("identify", "-format", format_option("%r"), escaped_path).split("\n")[0]
when "format"
run_command("identify", "-format", format_option("%m"), escaped_path).split("\n")[0]
when "height"
View
1  test/image_test.rb
@@ -111,6 +111,7 @@ def test_image_meta_info
assert_equal 150, image[:width]
assert_equal 55, image[:height]
assert_equal [150, 55], image[:dimensions]
+ assert_equal 'PseudoClassRGB', image[:colorspace]
assert_match(/^gif$/i, image[:format])
image.destroy!
end
Please sign in to comment.
Something went wrong with that request. Please try again.