micro_magick 0.0.3 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
data/.travis.yml ADDED
@@ -0,0 +1,10 @@
1
+ language: ruby
2
+ script: bundle exec rake
3
+ before_install:
4
+ - sudo apt-get update
5
+ - sudo apt-get install graphicsmagick imagemagick
6
+ rvm:
7
+ - 1.8.7
8
+ - 1.9.3
9
+ - jruby-18mode # JRuby in 1.8 mode
10
+ - jruby-19mode # JRuby in 1.9 mode
data/README.md CHANGED
@@ -1,26 +1,11 @@
1
- # Simplest possible ruby wrapper for [ImageMagick](http://www.imagemagick.org/) and [GraphicsMagick](http://www.graphicsmagick.org/)
1
+ # [ImageMagick](http://www.imagemagick.org/)/[GraphicsMagick](http://www.graphicsmagick.org/) Ruby wrapper
2
2
 
3
- ### OMG, SRSLY?
4
-
5
- Yes. Seriously.
6
-
7
- ### The other five libraries didn't make you happy?
8
-
9
- No.
10
-
11
- ### OK, Sunshine, cry me a river.
12
-
13
- All I wanted was something that
14
-
15
- * didn't create temporary files unnecessarily (like mini_magick)
16
- * didn't fail with valid geometry specifications, like ```640x480>``` (like mini_magick and quick_magick)
17
- * didn't assume you only needed to resize your images (like imagery)
18
- * didn't think you're going to run a public image caching service (like magickly)
3
+ [![Build Status](https://secure.travis-ci.org/mceachen/micro_magick.png)](http://travis-ci.org/mceachen/micro_magick)
19
4
 
20
5
  ## Usage
21
6
 
22
- ```micro_magick``` is an exec wrapper for the ```convert``` command, which reads from an image
23
- source, performs operations on it, and saves the result to a different file.
7
+ ```micro_magick``` is an exec wrapper for the ```convert``` command in either GraphicsMagick or ImageMagic.
8
+ ```convert``` reads an image from a given input file, performs operations on it, then saves the result to a different file.
24
9
 
25
10
  ```ruby
26
11
  img = MicroMagick::Convert.new("/path/to/image.jpg")
@@ -38,6 +23,23 @@ This results in the following system call:
38
23
 
39
24
  ```gm convert -size 640x480 /path/to/image.jpg +profile \* -quality 85 -resize "640x480>" /new/path/image-640x480.jpg```
40
25
 
26
+
27
+ ### Installation
28
+
29
+ You'll want to [install GraphicsMagick](http://www.graphicsmagick.org/README.html), then
30
+
31
+ ```
32
+ gem install micro_magick
33
+ ```
34
+
35
+ or add to your Gemfile:
36
+
37
+ ```
38
+ gem 'micro_magick'
39
+ ```
40
+
41
+ and run ```bundle```.
42
+
41
43
  ### "Plus" options
42
44
 
43
45
  To add an output option that has a "plus" prefix, like, ```+matte```, use ```.add_output_option("+matte")```.
@@ -49,8 +51,6 @@ There are a couple additional methods that have been added to address common ima
49
51
  * ```img.strip``` removes all comments and EXIF headers
50
52
  * ```img.square_crop``` crops the image to a square (so a 640x480 image would crop down to a 480x480 image, cropped in the middle).
51
53
 
52
-
53
-
54
54
  Note that all of ```convert```'s options are supported, but ```micro_magick``` does no validations.
55
55
  A ```MicroMagick::ArgumentError``` will be raised on ```.write``` if
56
56
  convert writes anything to stderr or the return value is not 0.
@@ -60,7 +60,7 @@ but you can force the library MicroMagick uses by calling ```MicroMagick.use(:gr
60
60
 
61
61
  In-place image edits through ```mogrify``` are not supported (yet).
62
62
 
63
- ### GraphicsMagick versus ImageMagick
63
+ ## GraphicsMagick versus ImageMagick
64
64
 
65
65
  *At least in my testing, GraphicsMagick blows ImageMagick out of the water.*
66
66
 
@@ -71,21 +71,14 @@ In resizing a 2248x4000 image to 640x480:
71
71
 
72
72
  Not only is GraphicsMagick 4 times faster, it produces 2.5x smaller output with the same quality--WIN WIN.
73
73
 
74
- ## Installation
75
-
76
- You'll want to [install GraphicsMagick](http://www.graphicsmagick.org/README.html), then
77
-
78
- ```
79
- gem install micro_magick
80
- ```
74
+ ## MicroMagick versus the competition
81
75
 
82
- or add to your Gemfile:
76
+ Why does the world need another *Magick wrapper? Because I needed a library that:
83
77
 
84
- ```
85
- gem 'micro_magick'
86
- ```
87
-
88
- and run ```bundle```.
78
+ * didn't create temporary files unnecessarily (like mini_magick)
79
+ * didn't fail with valid geometry specifications, like ```640x480>``` (like mini_magick and quick_magick)
80
+ * didn't assume you only needed to resize your images (like imagery)
81
+ * didn't think you're going to run a public image caching service (like magickly)
89
82
 
90
83
  ## Change history
91
84
 
@@ -96,3 +89,7 @@ Let's get this party started.
96
89
  ### 0.0.3
97
90
 
98
91
  Added square_crop, image dimensions, and support for ```+option```s.
92
+
93
+ ### 0.0.4
94
+
95
+ Input file -size render hint is now only used with simple dimension specifications
@@ -46,10 +46,12 @@ module MicroMagick
46
46
  # * and we have dimensions in the form of NNNxNNN
47
47
  if %w{-geometry -resize -sample -scale}.include?(option_name) &&
48
48
  @input_options.empty? &&
49
- !@output_options.include?("-crop") &&
50
- (dimensions = args.first) &&
51
- (simple_dim = dimensions.scan(/(\d+x\d+)/).first)
52
- @input_options << "-size #{simple_dim}"
49
+ !@output_options.include?("-crop")
50
+ if (dimensions = args.first)
51
+ if dimensions =~ /^(\d+x\d+)$/
52
+ @input_options << "-size #{dimensions}"
53
+ end
54
+ end
53
55
  end
54
56
  end
55
57
 
@@ -1,3 +1,3 @@
1
1
  module MicroMagick
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.5"
3
3
  end
data/micro_magick.gemspec CHANGED
@@ -7,7 +7,7 @@ Gem::Specification.new do |s|
7
7
  s.version = MicroMagick::VERSION
8
8
  s.authors = ["Matthew McEachen"]
9
9
  s.email = ["matthew-github@mceachen.org"]
10
- s.homepage = ""
10
+ s.homepage = "https://github.com/mceachen/micro_magick"
11
11
  s.summary = %q{Simplest ImageMagick/GraphicsMagick ruby wrapper EVAR}
12
12
  s.description = %q{Simplest ImageMagick/GraphicsMagick ruby wrapper EVAR}
13
13
 
@@ -1,4 +1,5 @@
1
1
  require "test/unit"
2
+ require "micro_magick"
2
3
 
3
4
  class GeometryTest < Test::Unit::TestCase
4
5
  def test_geometry
@@ -1,4 +1,4 @@
1
- require "test/micro_magick_test_base"
1
+ require "./test/micro_magick_test_base"
2
2
 
3
3
  class MicroGmagickTest < MicroMagickTestBase
4
4
 
@@ -1,4 +1,4 @@
1
- require "test/micro_magick_test_base"
1
+ require "./test/micro_magick_test_base"
2
2
 
3
3
  class MicroImagickTest < MicroMagickTestBase
4
4
 
@@ -1,4 +1,5 @@
1
1
  require "test/unit"
2
+ require "micro_magick"
2
3
 
3
4
  class MicroMagickTest < Test::Unit::TestCase
4
5
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: micro_magick
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 3
10
- version: 0.0.3
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Matthew McEachen
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-03-04 00:00:00 Z
18
+ date: 2012-03-05 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  prerelease: false
@@ -42,6 +42,7 @@ extra_rdoc_files: []
42
42
 
43
43
  files:
44
44
  - .gitignore
45
+ - .travis.yml
45
46
  - Gemfile
46
47
  - README.md
47
48
  - Rakefile
@@ -56,7 +57,7 @@ files:
56
57
  - test/micro_imagick_test.rb
57
58
  - test/micro_magick_test.rb
58
59
  - test/micro_magick_test_base.rb
59
- homepage: ""
60
+ homepage: https://github.com/mceachen/micro_magick
60
61
  licenses: []
61
62
 
62
63
  post_install_message: