micro_magick 0.0.5 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +15 -0
- data/lib/micro_magick/version.rb +1 -1
- metadata +39 -65
- data/.gitignore +0 -4
- data/.travis.yml +0 -10
- data/Gemfile +0 -4
- data/README.md +0 -95
- data/Rakefile +0 -7
- data/micro_magick.gemspec +0 -22
checksums.yaml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
!binary "U0hBMQ==":
|
|
3
|
+
metadata.gz: !binary |-
|
|
4
|
+
MmJlNTMwZTY3OTVhNmIxZDQwNzE4OWRkZjU1Mzk3NTdmZmY2Nzk1Mw==
|
|
5
|
+
data.tar.gz: !binary |-
|
|
6
|
+
ZDdmODVlZjMzZjhjNjkzMWIwNmU3YWExMzQwMzJjMzM0YzFlNTBlNA==
|
|
7
|
+
!binary "U0hBNTEy":
|
|
8
|
+
metadata.gz: !binary |-
|
|
9
|
+
MjljYjdhNDk3MjVhYTlmMzFiNmE5ZDU2YmM5NTJmMDMwZTBmYjNkZDIyNmJi
|
|
10
|
+
YTE5YWY0Y2NjZGFjYTA1ZDg2NzllMmMwNGQ1YjM3MzhmODAzOWU0M2VjOTgw
|
|
11
|
+
MjZmNTFmMThkNzUwMmJiMjM1MWE0ZDlhYmFjN2I3N2U3YjFmZjY=
|
|
12
|
+
data.tar.gz: !binary |-
|
|
13
|
+
Y2I5YTAyZGEyYTMzNmE1ZGExOTVkNjAxNDE2ZDBkMzljMzljMDcyMmYyZDNh
|
|
14
|
+
ZjViOTUyZGZkOTJiMWExNjZkYjY0NTBlZDg1Y2VkNDY0OWE2OTZjNzZjOTAw
|
|
15
|
+
ZmMzNGZiZWNjNGYyMGE0NzVjNTk3MGIzNGNhN2RiZTY1OWI4OWY=
|
data/lib/micro_magick/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,56 +1,40 @@
|
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: micro_magick
|
|
3
|
-
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
5
|
-
prerelease:
|
|
6
|
-
segments:
|
|
7
|
-
- 0
|
|
8
|
-
- 0
|
|
9
|
-
- 5
|
|
10
|
-
version: 0.0.5
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.6
|
|
11
5
|
platform: ruby
|
|
12
|
-
authors:
|
|
6
|
+
authors:
|
|
13
7
|
- Matthew McEachen
|
|
14
8
|
autorequire:
|
|
15
9
|
bindir: bin
|
|
16
10
|
cert_chain: []
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
- !ruby/object:Gem::Dependency
|
|
21
|
-
prerelease: false
|
|
22
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
|
23
|
-
none: false
|
|
24
|
-
requirements:
|
|
25
|
-
- - ">="
|
|
26
|
-
- !ruby/object:Gem::Version
|
|
27
|
-
hash: 3
|
|
28
|
-
segments:
|
|
29
|
-
- 0
|
|
30
|
-
version: "0"
|
|
31
|
-
type: :development
|
|
11
|
+
date: 2013-06-23 00:00:00.000000000 Z
|
|
12
|
+
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
32
14
|
name: rake
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ! '>='
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '0'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ! '>='
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '0'
|
|
27
|
+
description: ''
|
|
28
|
+
email:
|
|
36
29
|
- matthew-github@mceachen.org
|
|
37
30
|
executables: []
|
|
38
|
-
|
|
39
31
|
extensions: []
|
|
40
|
-
|
|
41
32
|
extra_rdoc_files: []
|
|
42
|
-
|
|
43
|
-
files:
|
|
44
|
-
- .gitignore
|
|
45
|
-
- .travis.yml
|
|
46
|
-
- Gemfile
|
|
47
|
-
- README.md
|
|
48
|
-
- Rakefile
|
|
33
|
+
files:
|
|
49
34
|
- lib/micro_magick.rb
|
|
50
35
|
- lib/micro_magick/convert.rb
|
|
51
36
|
- lib/micro_magick/geometry.rb
|
|
52
37
|
- lib/micro_magick/version.rb
|
|
53
|
-
- micro_magick.gemspec
|
|
54
38
|
- test/480x270.jpg
|
|
55
39
|
- test/geometry_test.rb
|
|
56
40
|
- test/micro_gmagick_test.rb
|
|
@@ -59,38 +43,28 @@ files:
|
|
|
59
43
|
- test/micro_magick_test_base.rb
|
|
60
44
|
homepage: https://github.com/mceachen/micro_magick
|
|
61
45
|
licenses: []
|
|
62
|
-
|
|
46
|
+
metadata: {}
|
|
63
47
|
post_install_message:
|
|
64
48
|
rdoc_options: []
|
|
65
|
-
|
|
66
|
-
require_paths:
|
|
49
|
+
require_paths:
|
|
67
50
|
- lib
|
|
68
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
none: false
|
|
79
|
-
requirements:
|
|
80
|
-
- - ">="
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
hash: 3
|
|
83
|
-
segments:
|
|
84
|
-
- 0
|
|
85
|
-
version: "0"
|
|
51
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
52
|
+
requirements:
|
|
53
|
+
- - ! '>='
|
|
54
|
+
- !ruby/object:Gem::Version
|
|
55
|
+
version: '0'
|
|
56
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
|
+
requirements:
|
|
58
|
+
- - ! '>='
|
|
59
|
+
- !ruby/object:Gem::Version
|
|
60
|
+
version: '0'
|
|
86
61
|
requirements: []
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
rubygems_version: 1.8.17
|
|
62
|
+
rubyforge_project:
|
|
63
|
+
rubygems_version: 2.0.3
|
|
90
64
|
signing_key:
|
|
91
|
-
specification_version:
|
|
92
|
-
summary:
|
|
93
|
-
test_files:
|
|
65
|
+
specification_version: 4
|
|
66
|
+
summary: The simplest and most correct ImageMagick/GraphicsMagick ruby wrapper
|
|
67
|
+
test_files:
|
|
94
68
|
- test/480x270.jpg
|
|
95
69
|
- test/geometry_test.rb
|
|
96
70
|
- test/micro_gmagick_test.rb
|
data/.gitignore
DELETED
data/.travis.yml
DELETED
data/Gemfile
DELETED
data/README.md
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
# [ImageMagick](http://www.imagemagick.org/)/[GraphicsMagick](http://www.graphicsmagick.org/) Ruby wrapper
|
|
2
|
-
|
|
3
|
-
[](http://travis-ci.org/mceachen/micro_magick)
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
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.
|
|
9
|
-
|
|
10
|
-
```ruby
|
|
11
|
-
img = MicroMagick::Convert.new("/path/to/image.jpg")
|
|
12
|
-
img.width
|
|
13
|
-
# => 3264
|
|
14
|
-
img.height
|
|
15
|
-
# => 2448
|
|
16
|
-
img.strip
|
|
17
|
-
img.quality(85)
|
|
18
|
-
img.resize("640x480>")
|
|
19
|
-
img.write("/new/path/image-640x480.jpg")
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
This results in the following system call:
|
|
23
|
-
|
|
24
|
-
```gm convert -size 640x480 /path/to/image.jpg +profile \* -quality 85 -resize "640x480>" /new/path/image-640x480.jpg```
|
|
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
|
-
|
|
43
|
-
### "Plus" options
|
|
44
|
-
|
|
45
|
-
To add an output option that has a "plus" prefix, like, ```+matte```, use ```.add_output_option("+matte")```.
|
|
46
|
-
|
|
47
|
-
### Goodies
|
|
48
|
-
|
|
49
|
-
There are a couple additional methods that have been added to address common image tasks:
|
|
50
|
-
|
|
51
|
-
* ```img.strip``` removes all comments and EXIF headers
|
|
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).
|
|
53
|
-
|
|
54
|
-
Note that all of ```convert```'s options are supported, but ```micro_magick``` does no validations.
|
|
55
|
-
A ```MicroMagick::ArgumentError``` will be raised on ```.write``` if
|
|
56
|
-
convert writes anything to stderr or the return value is not 0.
|
|
57
|
-
|
|
58
|
-
Note also that GraphicsMagick will be used automatically, if it's in ruby's PATH, and then will fall back to ImageMagick,
|
|
59
|
-
but you can force the library MicroMagick uses by calling ```MicroMagick.use(:graphicsmagick)``` or ```MicroMagick.use(:imagemagick)```.
|
|
60
|
-
|
|
61
|
-
In-place image edits through ```mogrify``` are not supported (yet).
|
|
62
|
-
|
|
63
|
-
## GraphicsMagick versus ImageMagick
|
|
64
|
-
|
|
65
|
-
*At least in my testing, GraphicsMagick blows ImageMagick out of the water.*
|
|
66
|
-
|
|
67
|
-
In resizing a 2248x4000 image to 640x480:
|
|
68
|
-
|
|
69
|
-
* GraphicsMagick takes ~140 milliseconds. ImageMagick takes ~550 millis.
|
|
70
|
-
* GraphicsMagick outputs a 37K JPG, ImageMagick outputs a 94K JPG, with no detectable visual differences.
|
|
71
|
-
|
|
72
|
-
Not only is GraphicsMagick 4 times faster, it produces 2.5x smaller output with the same quality--WIN WIN.
|
|
73
|
-
|
|
74
|
-
## MicroMagick versus the competition
|
|
75
|
-
|
|
76
|
-
Why does the world need another *Magick wrapper? Because I needed a library that:
|
|
77
|
-
|
|
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)
|
|
82
|
-
|
|
83
|
-
## Change history
|
|
84
|
-
|
|
85
|
-
### 0.0.1
|
|
86
|
-
|
|
87
|
-
Let's get this party started.
|
|
88
|
-
|
|
89
|
-
### 0.0.3
|
|
90
|
-
|
|
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
|
data/Rakefile
DELETED
data/micro_magick.gemspec
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
$:.push File.expand_path("../lib", __FILE__)
|
|
3
|
-
require "micro_magick/version"
|
|
4
|
-
|
|
5
|
-
Gem::Specification.new do |s|
|
|
6
|
-
s.name = "micro_magick"
|
|
7
|
-
s.version = MicroMagick::VERSION
|
|
8
|
-
s.authors = ["Matthew McEachen"]
|
|
9
|
-
s.email = ["matthew-github@mceachen.org"]
|
|
10
|
-
s.homepage = "https://github.com/mceachen/micro_magick"
|
|
11
|
-
s.summary = %q{Simplest ImageMagick/GraphicsMagick ruby wrapper EVAR}
|
|
12
|
-
s.description = %q{Simplest ImageMagick/GraphicsMagick ruby wrapper EVAR}
|
|
13
|
-
|
|
14
|
-
s.rubyforge_project = "micro_magick"
|
|
15
|
-
|
|
16
|
-
s.files = `git ls-files`.split("\n")
|
|
17
|
-
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
|
18
|
-
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
|
19
|
-
s.require_paths = ["lib"]
|
|
20
|
-
|
|
21
|
-
s.add_development_dependency "rake"
|
|
22
|
-
end
|