mini_magick 1.3.2 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of mini_magick might be problematic. Click here for more details.

data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.3.2
1
+ 1.3.3
data/lib/mini_magick.rb CHANGED
@@ -139,9 +139,11 @@ module MiniMagick
139
139
  # If an unknown method is called then it is sent through the morgrify program
140
140
  # Look here to find all the commands (http://www.imagemagick.org/script/mogrify.php)
141
141
  def method_missing(symbol, *args)
142
- if MOGRIFY_COMMANDS.include?(symbol.to_s)
142
+ guessed_command_name = symbol.to_s.gsub('_','-')
143
+
144
+ if MOGRIFY_COMMANDS.include?(guessed_command_name)
143
145
  args.push(@path) # push the path onto the end
144
- run_command("mogrify", "-#{symbol}", *args)
146
+ run_command("mogrify", "-#{guessed_command_name}", *args)
145
147
  self
146
148
  else
147
149
  super(symbol, *args)
@@ -229,7 +231,7 @@ module MiniMagick
229
231
  end
230
232
 
231
233
  def method_missing(symbol, *args)
232
- @args << "-#{symbol}"
234
+ @args << "-#{symbol.to_s.gsub('_','-')}"
233
235
  @args += args
234
236
  end
235
237
 
@@ -18,4 +18,10 @@ class CommandBuilderTest < Test::Unit::TestCase
18
18
  c.lingo "mome fingo"
19
19
  assert_equal "-resize 30x40 -input 1 3 4 -lingo mome fingo", c.args.join(" ")
20
20
  end
21
+
22
+ def test_dashed
23
+ c = CommandBuilder.new
24
+ c.auto_orient
25
+ assert_equal "-auto-orient", c.args.join(" ")
26
+ end
21
27
  end
data/test/image_test.rb CHANGED
@@ -15,6 +15,7 @@ class ImageTest < Test::Unit::TestCase
15
15
  NOT_AN_IMAGE_PATH = CURRENT_DIR + "not_an_image.php"
16
16
  GIF_WITH_JPG_EXT = CURRENT_DIR + "actually_a_gif.jpg"
17
17
  EXIF_IMAGE_PATH = CURRENT_DIR + "trogdor.jpg"
18
+ ORIENTED_IMAGE_PATH = CURRENT_DIR + "oliver.jpg"
18
19
  ANIMATION_PATH = CURRENT_DIR + "animation.gif"
19
20
 
20
21
  def test_image_from_blob
@@ -140,6 +141,15 @@ class ImageTest < Test::Unit::TestCase
140
141
  assert_equal('', image["EXIF:ExifVersion"])
141
142
  image.destroy!
142
143
  end
144
+
145
+ # The test here isn't really to check to see if
146
+ # the auto-orient function of ImageMagick works,
147
+ # but to make sure we can send dashed commands.
148
+ def test_auto_rotate
149
+ image = Image.from_file(EXIF_IMAGE_PATH)
150
+ image.auto_orient
151
+ image.destroy!
152
+ end
143
153
 
144
154
  def test_original_at
145
155
  image = Image.from_file(EXIF_IMAGE_PATH)
data/test/trogdor.jpg CHANGED
Binary file
metadata CHANGED
@@ -1,13 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mini_magick
3
3
  version: !ruby/object:Gem::Version
4
- hash: 31
5
4
  prerelease: false
6
5
  segments:
7
6
  - 1
8
7
  - 3
9
- - 2
10
- version: 1.3.2
8
+ - 3
9
+ version: 1.3.3
11
10
  platform: ruby
12
11
  authors:
13
12
  - Corey Johnson
@@ -17,7 +16,7 @@ autorequire:
17
16
  bindir: bin
18
17
  cert_chain: []
19
18
 
20
- date: 2010-08-02 00:00:00 -07:00
19
+ date: 2010-08-17 00:00:00 +01:00
21
20
  default_executable:
22
21
  dependencies:
23
22
  - !ruby/object:Gem::Dependency
@@ -28,7 +27,6 @@ dependencies:
28
27
  requirements:
29
28
  - - ~>
30
29
  - !ruby/object:Gem::Version
31
- hash: 23
32
30
  segments:
33
31
  - 0
34
32
  - 0
@@ -77,7 +75,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
75
  requirements:
78
76
  - - ">="
79
77
  - !ruby/object:Gem::Version
80
- hash: 3
81
78
  segments:
82
79
  - 0
83
80
  version: "0"
@@ -86,7 +83,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
83
  requirements:
87
84
  - - ">="
88
85
  - !ruby/object:Gem::Version
89
- hash: 3
90
86
  segments:
91
87
  - 0
92
88
  version: "0"