mini_magick 1.2.5 → 1.3.1
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.
- data/README.rdoc +5 -2
- data/Rakefile +5 -41
- data/VERSION +1 -1
- data/lib/mini_gmagick.rb +2 -0
- data/lib/mini_magick.rb +42 -18
- data/test/command_builder_test.rb +2 -1
- data/test/image_test.rb +49 -17
- data/test/simple-minus.gif +0 -0
- metadata +60 -24
- data/.gitignore +0 -1
- data/lib/image_temp_file.rb +0 -9
- data/mini_magick.gemspec +0 -55
- data/test/image_temp_file_test.rb +0 -17
data/README.rdoc
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
= MiniMagick
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
NOTE: I'm not actively using MiniMagick anymore and am looking to hand it off
|
|
4
|
+
to someone with more interest. Contact me through github if that person is you!
|
|
5
|
+
|
|
6
|
+
A ruby wrapper for ImageMagick or GraphicsMagick command line.
|
|
4
7
|
|
|
5
8
|
|
|
6
9
|
== Why?
|
|
@@ -69,4 +72,4 @@ http://www.imagemagick.org/script/command-line-options.php#format
|
|
|
69
72
|
|
|
70
73
|
== Requirements
|
|
71
74
|
|
|
72
|
-
You must have ImageMagick installed.
|
|
75
|
+
You must have ImageMagick or GraphicsMagick installed.
|
data/Rakefile
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
require 'rake'
|
|
2
2
|
require 'rake/testtask'
|
|
3
3
|
require 'rake/rdoctask'
|
|
4
|
+
require 'rake/gempackagetask'
|
|
4
5
|
|
|
5
6
|
$:.unshift(File.dirname(__FILE__) + "/lib")
|
|
6
7
|
require 'mini_magick'
|
|
@@ -10,7 +11,7 @@ task :default => :test
|
|
|
10
11
|
|
|
11
12
|
desc 'Test the mini_magick plugin.'
|
|
12
13
|
Rake::TestTask.new(:test) do |t|
|
|
13
|
-
t.libs << '
|
|
14
|
+
t.libs << 'test'
|
|
14
15
|
t.pattern = 'test/**/*_test.rb'
|
|
15
16
|
t.verbose = true
|
|
16
17
|
end
|
|
@@ -25,44 +26,7 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
|
25
26
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
26
27
|
end
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
require 'jeweler'
|
|
32
|
-
Jeweler::Tasks.new do |gemspec|
|
|
33
|
-
gemspec.name = "mini_magick"
|
|
34
|
-
gemspec.summary = "Manipulate images with minimal use of memory."
|
|
35
|
-
gemspec.email = "probablycorey@gmail.com"
|
|
36
|
-
gemspec.homepage = "http://github.com/probablycorey/mini_magick"
|
|
37
|
-
gemspec.authors = ["Corey Johnson"]
|
|
38
|
-
gemspec.rubyforge_project = "mini-magick"
|
|
39
|
-
end
|
|
40
|
-
rescue LoadError
|
|
41
|
-
puts "Jeweler not available. Install it with: sudo gem install technicalpickles-jeweler -s http://gems.github.com"
|
|
42
|
-
end
|
|
43
|
-
|
|
44
|
-
begin
|
|
45
|
-
require 'rake/contrib/sshpublisher'
|
|
46
|
-
namespace :rubyforge do
|
|
47
|
-
|
|
48
|
-
desc "Release gem and RDoc documentation to RubyForge"
|
|
49
|
-
task :release => ["rubyforge:release:gem", "rubyforge:release:docs"]
|
|
50
|
-
|
|
51
|
-
namespace :release do
|
|
52
|
-
desc "Publish RDoc to RubyForge."
|
|
53
|
-
task :docs => [:rdoc] do
|
|
54
|
-
config = YAML.load(
|
|
55
|
-
File.read(File.expand_path('~/.rubyforge/user-config.yml'))
|
|
56
|
-
)
|
|
57
|
-
|
|
58
|
-
host = "#{config['username']}@rubyforge.org"
|
|
59
|
-
remote_dir = "/var/www/gforge-projects/the-perfect-gem/"
|
|
60
|
-
local_dir = 'rdoc'
|
|
61
|
-
|
|
62
|
-
Rake::SshDirPublisher.new(host, remote_dir, local_dir).upload
|
|
63
|
-
end
|
|
64
|
-
end
|
|
65
|
-
end
|
|
66
|
-
rescue LoadError
|
|
67
|
-
puts "Rake SshDirPublisher is unavailable or your rubyforge environment is not configured."
|
|
29
|
+
spec = eval(File.read('mini_magick.gemspec'))
|
|
30
|
+
Rake::GemPackageTask.new(spec) do |pkg|
|
|
31
|
+
pkg.gem_spec = spec
|
|
68
32
|
end
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.
|
|
1
|
+
1.3.1
|
data/lib/mini_gmagick.rb
ADDED
data/lib/mini_magick.rb
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
require
|
|
2
|
-
require
|
|
3
|
-
require "fileutils"
|
|
4
|
-
require "open3"
|
|
5
|
-
|
|
6
|
-
require File.join(File.dirname(__FILE__), '/image_temp_file')
|
|
1
|
+
require 'tempfile'
|
|
2
|
+
require 'subexec'
|
|
7
3
|
|
|
8
4
|
module MiniMagick
|
|
9
|
-
class
|
|
5
|
+
class << self
|
|
6
|
+
attr_accessor :processor
|
|
7
|
+
attr_accessor :timeout
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class Error < RuntimeError; end
|
|
11
|
+
class Invalid < StandardError; end
|
|
10
12
|
|
|
11
13
|
class Image
|
|
12
14
|
attr :path
|
|
@@ -18,7 +20,7 @@ module MiniMagick
|
|
|
18
20
|
class << self
|
|
19
21
|
def from_blob(blob, ext = nil)
|
|
20
22
|
begin
|
|
21
|
-
tempfile =
|
|
23
|
+
tempfile = Tempfile.new(['mini_magick', ext.to_s])
|
|
22
24
|
tempfile.binmode
|
|
23
25
|
tempfile.write(blob)
|
|
24
26
|
ensure
|
|
@@ -84,14 +86,14 @@ module MiniMagick
|
|
|
84
86
|
run_command("mogrify", "-format", format, @path)
|
|
85
87
|
|
|
86
88
|
old_path = @path.dup
|
|
87
|
-
@path.sub!(/(\.\w
|
|
89
|
+
@path.sub!(/(\.\w*)?$/, ".#{format}")
|
|
88
90
|
File.delete(old_path) unless old_path == @path
|
|
89
91
|
|
|
90
92
|
unless File.exists?(@path)
|
|
91
93
|
begin
|
|
92
94
|
FileUtils.copy_file(@path.sub(".#{format}", "-#{page}.#{format}"), @path)
|
|
93
|
-
rescue
|
|
94
|
-
raise MiniMagickError, "Unable to format to #{format}; #{
|
|
95
|
+
rescue => ex
|
|
96
|
+
raise MiniMagickError, "Unable to format to #{format}; #{ex}" unless File.exist?(@path)
|
|
95
97
|
end
|
|
96
98
|
end
|
|
97
99
|
ensure
|
|
@@ -99,6 +101,12 @@ module MiniMagick
|
|
|
99
101
|
File.unlink(fname)
|
|
100
102
|
end
|
|
101
103
|
end
|
|
104
|
+
|
|
105
|
+
# Collapse images with sequences to the first frame (ie. animated gifs) and
|
|
106
|
+
# preserve quality
|
|
107
|
+
def collapse!
|
|
108
|
+
run_command("mogrify", "-quality", "100", "#{path}[0]")
|
|
109
|
+
end
|
|
102
110
|
|
|
103
111
|
# Writes the temporary image that we are using for processing to the output path
|
|
104
112
|
def write(output_path)
|
|
@@ -143,22 +151,38 @@ module MiniMagick
|
|
|
143
151
|
def run_command(command, *args)
|
|
144
152
|
args.collect! do |arg|
|
|
145
153
|
# args can contain characters like '>' so we must escape them, but don't quote switches
|
|
146
|
-
if arg !~
|
|
154
|
+
if arg !~ /^[\+\-]/
|
|
147
155
|
"\"#{arg}\""
|
|
148
156
|
else
|
|
149
157
|
arg.to_s
|
|
150
158
|
end
|
|
151
159
|
end
|
|
152
160
|
|
|
153
|
-
command = "#{command} #{args.join(' ')}"
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
if
|
|
157
|
-
|
|
161
|
+
command = "#{MiniMagick.processor} #{command} #{args.join(' ')}".strip
|
|
162
|
+
sub = Subexec.run(command, :timeout => MiniMagick.timeout)
|
|
163
|
+
|
|
164
|
+
if sub.exitstatus != 0
|
|
165
|
+
# Clean up after ourselves in case of an error
|
|
166
|
+
destroy!
|
|
167
|
+
|
|
168
|
+
# Raise the appropriate error
|
|
169
|
+
if sub.output =~ /no decode delegate/i || sub.output =~ /did not return an image/i
|
|
170
|
+
raise Invalid, sub.output
|
|
171
|
+
else
|
|
172
|
+
# TODO: should we do something different if the command times out ...?
|
|
173
|
+
# its definitely better for logging.. otherwise we dont really know
|
|
174
|
+
raise Error, "Command (#{command.inspect}) failed: #{{:status_code => sub.exitstatus, :output => sub.output}.inspect}"
|
|
175
|
+
end
|
|
158
176
|
else
|
|
159
|
-
output
|
|
177
|
+
sub.output
|
|
160
178
|
end
|
|
161
179
|
end
|
|
180
|
+
|
|
181
|
+
def destroy!
|
|
182
|
+
return if tempfile.nil?
|
|
183
|
+
File.unlink(tempfile.path)
|
|
184
|
+
@tempfile = nil
|
|
185
|
+
end
|
|
162
186
|
end
|
|
163
187
|
|
|
164
188
|
class CommandBuilder
|
data/test/image_test.rb
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
|
+
require 'rubygems'
|
|
1
2
|
require 'test/unit'
|
|
2
|
-
require
|
|
3
|
+
require 'mini_magick'
|
|
4
|
+
|
|
5
|
+
MiniMagick.processor = :gm
|
|
3
6
|
|
|
4
7
|
class ImageTest < Test::Unit::TestCase
|
|
5
8
|
include MiniMagick
|
|
@@ -7,6 +10,7 @@ class ImageTest < Test::Unit::TestCase
|
|
|
7
10
|
CURRENT_DIR = File.dirname(File.expand_path(__FILE__)) + "/"
|
|
8
11
|
|
|
9
12
|
SIMPLE_IMAGE_PATH = CURRENT_DIR + "simple.gif"
|
|
13
|
+
MINUS_IMAGE_PATH = CURRENT_DIR + "simple-minus.gif"
|
|
10
14
|
TIFF_IMAGE_PATH = CURRENT_DIR + "leaves.tiff"
|
|
11
15
|
NOT_AN_IMAGE_PATH = CURRENT_DIR + "not_an_image.php"
|
|
12
16
|
GIF_WITH_JPG_EXT = CURRENT_DIR + "actually_a_gif.jpg"
|
|
@@ -16,15 +20,18 @@ class ImageTest < Test::Unit::TestCase
|
|
|
16
20
|
def test_image_from_blob
|
|
17
21
|
File.open(SIMPLE_IMAGE_PATH, "rb") do |f|
|
|
18
22
|
image = Image.from_blob(f.read)
|
|
23
|
+
image.destroy!
|
|
19
24
|
end
|
|
20
25
|
end
|
|
21
26
|
|
|
22
27
|
def test_image_from_file
|
|
23
28
|
image = Image.from_file(SIMPLE_IMAGE_PATH)
|
|
29
|
+
image.destroy!
|
|
24
30
|
end
|
|
25
31
|
|
|
26
32
|
def test_image_new
|
|
27
33
|
image = Image.new(SIMPLE_IMAGE_PATH)
|
|
34
|
+
image.destroy!
|
|
28
35
|
end
|
|
29
36
|
|
|
30
37
|
def test_image_write
|
|
@@ -37,11 +44,13 @@ class ImageTest < Test::Unit::TestCase
|
|
|
37
44
|
ensure
|
|
38
45
|
File.delete output_path
|
|
39
46
|
end
|
|
47
|
+
image.destroy!
|
|
40
48
|
end
|
|
41
49
|
|
|
42
50
|
def test_not_an_image
|
|
43
|
-
assert_raise(
|
|
51
|
+
assert_raise(MiniMagick::Invalid) do
|
|
44
52
|
image = Image.new(NOT_AN_IMAGE_PATH)
|
|
53
|
+
image.destroy!
|
|
45
54
|
end
|
|
46
55
|
end
|
|
47
56
|
|
|
@@ -51,6 +60,7 @@ class ImageTest < Test::Unit::TestCase
|
|
|
51
60
|
assert_equal 55, image[:height]
|
|
52
61
|
assert_equal [150, 55], image[:dimensions]
|
|
53
62
|
assert_match(/^gif$/i, image[:format])
|
|
63
|
+
image.destroy!
|
|
54
64
|
end
|
|
55
65
|
|
|
56
66
|
def test_tiff
|
|
@@ -58,22 +68,26 @@ class ImageTest < Test::Unit::TestCase
|
|
|
58
68
|
assert_equal "tiff", image[:format].downcase
|
|
59
69
|
assert_equal 295, image[:width]
|
|
60
70
|
assert_equal 242, image[:height]
|
|
71
|
+
image.destroy!
|
|
61
72
|
end
|
|
62
73
|
|
|
63
|
-
def test_animation_pages
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
74
|
+
# def test_animation_pages
|
|
75
|
+
# image = Image.from_file(ANIMATION_PATH)
|
|
76
|
+
# image.format "png", 0
|
|
77
|
+
# assert_equal "png", image[:format].downcase
|
|
78
|
+
# image.destroy!
|
|
79
|
+
# end
|
|
68
80
|
|
|
69
|
-
def test_animation_size
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
81
|
+
# def test_animation_size
|
|
82
|
+
# image = Image.from_file(ANIMATION_PATH)
|
|
83
|
+
# assert_equal image[:size], 76631
|
|
84
|
+
# image.destroy!
|
|
85
|
+
# end
|
|
73
86
|
|
|
74
87
|
def test_gif_with_jpg_format
|
|
75
88
|
image = Image.new(GIF_WITH_JPG_EXT)
|
|
76
89
|
assert_equal "gif", image[:format].downcase
|
|
90
|
+
image.destroy!
|
|
77
91
|
end
|
|
78
92
|
|
|
79
93
|
def test_image_resize
|
|
@@ -83,6 +97,7 @@ class ImageTest < Test::Unit::TestCase
|
|
|
83
97
|
assert_equal 20, image[:width]
|
|
84
98
|
assert_equal 30, image[:height]
|
|
85
99
|
assert_match(/^gif$/i, image[:format])
|
|
100
|
+
image.destroy!
|
|
86
101
|
end
|
|
87
102
|
|
|
88
103
|
def test_image_resize_with_minimum
|
|
@@ -92,6 +107,7 @@ class ImageTest < Test::Unit::TestCase
|
|
|
92
107
|
|
|
93
108
|
assert_equal original_width, image[:width]
|
|
94
109
|
assert_equal original_height, image[:height]
|
|
110
|
+
image.destroy!
|
|
95
111
|
end
|
|
96
112
|
|
|
97
113
|
def test_image_combine_options_resize_blur
|
|
@@ -104,6 +120,17 @@ class ImageTest < Test::Unit::TestCase
|
|
|
104
120
|
assert_equal 20, image[:width]
|
|
105
121
|
assert_equal 30, image[:height]
|
|
106
122
|
assert_match(/^gif$/i, image[:format])
|
|
123
|
+
image.destroy!
|
|
124
|
+
end
|
|
125
|
+
|
|
126
|
+
def test_image_combine_options_with_filename_with_minusses_in_it
|
|
127
|
+
image = Image.from_file(SIMPLE_IMAGE_PATH)
|
|
128
|
+
assert_nothing_raised do
|
|
129
|
+
image.combine_options do |c|
|
|
130
|
+
c.draw "image Over 0,0 10,10 '#{MINUS_IMAGE_PATH}'"
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
image.destroy!
|
|
107
134
|
end
|
|
108
135
|
|
|
109
136
|
def test_exif
|
|
@@ -111,6 +138,7 @@ class ImageTest < Test::Unit::TestCase
|
|
|
111
138
|
assert_equal('0220', image["exif:ExifVersion"])
|
|
112
139
|
image = Image.from_file(SIMPLE_IMAGE_PATH)
|
|
113
140
|
assert_equal('', image["EXIF:ExifVersion"])
|
|
141
|
+
image.destroy!
|
|
114
142
|
end
|
|
115
143
|
|
|
116
144
|
def test_original_at
|
|
@@ -118,17 +146,20 @@ class ImageTest < Test::Unit::TestCase
|
|
|
118
146
|
assert_equal(Time.local('2005', '2', '23', '23', '17', '24'), image[:original_at])
|
|
119
147
|
image = Image.from_file(SIMPLE_IMAGE_PATH)
|
|
120
148
|
assert_nil(image[:original_at])
|
|
149
|
+
image.destroy!
|
|
121
150
|
end
|
|
122
151
|
|
|
123
152
|
def test_tempfile_at_path
|
|
124
153
|
image = Image.from_file(TIFF_IMAGE_PATH)
|
|
125
154
|
assert_equal image.path, image.tempfile.path
|
|
155
|
+
image.destroy!
|
|
126
156
|
end
|
|
127
157
|
|
|
128
158
|
def test_tempfile_at_path_after_format
|
|
129
159
|
image = Image.from_file(TIFF_IMAGE_PATH)
|
|
130
160
|
image.format('png')
|
|
131
161
|
assert_equal image.path, image.tempfile.path
|
|
162
|
+
image.destroy!
|
|
132
163
|
end
|
|
133
164
|
|
|
134
165
|
def test_previous_tempfile_deleted_after_format
|
|
@@ -136,12 +167,13 @@ class ImageTest < Test::Unit::TestCase
|
|
|
136
167
|
before = image.path.dup
|
|
137
168
|
image.format('png')
|
|
138
169
|
assert !File.exist?(before)
|
|
170
|
+
image.destroy!
|
|
139
171
|
end
|
|
140
172
|
|
|
141
|
-
def test_mini_magick_error_when_referencing_not_existing_page
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
end
|
|
173
|
+
# def test_mini_magick_error_when_referencing_not_existing_page
|
|
174
|
+
# image = Image.from_file(ANIMATION_PATH)
|
|
175
|
+
# image.format('png')
|
|
176
|
+
# assert_equal image[:format], 'PNG'
|
|
177
|
+
# image.destroy!
|
|
178
|
+
# end
|
|
147
179
|
end
|
|
Binary file
|
metadata
CHANGED
|
@@ -1,71 +1,107 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mini_magick
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
|
|
4
|
+
hash: 25
|
|
5
|
+
prerelease: false
|
|
6
|
+
segments:
|
|
7
|
+
- 1
|
|
8
|
+
- 3
|
|
9
|
+
- 1
|
|
10
|
+
version: 1.3.1
|
|
5
11
|
platform: ruby
|
|
6
12
|
authors:
|
|
7
13
|
- Corey Johnson
|
|
14
|
+
- Peter Kieltyka
|
|
8
15
|
autorequire:
|
|
9
16
|
bindir: bin
|
|
10
17
|
cert_chain: []
|
|
11
18
|
|
|
12
|
-
date:
|
|
19
|
+
date: 2010-07-08 00:00:00 -07:00
|
|
13
20
|
default_executable:
|
|
14
|
-
dependencies:
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
dependencies:
|
|
22
|
+
- !ruby/object:Gem::Dependency
|
|
23
|
+
name: subexec
|
|
24
|
+
prerelease: false
|
|
25
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
26
|
+
none: false
|
|
27
|
+
requirements:
|
|
28
|
+
- - ~>
|
|
29
|
+
- !ruby/object:Gem::Version
|
|
30
|
+
hash: 23
|
|
31
|
+
segments:
|
|
32
|
+
- 0
|
|
33
|
+
- 0
|
|
34
|
+
- 4
|
|
35
|
+
version: 0.0.4
|
|
36
|
+
type: :runtime
|
|
37
|
+
version_requirements: *id001
|
|
38
|
+
description: Manipulate images with minimal use of memory via ImageMagick / GraphicsMagick
|
|
39
|
+
email:
|
|
40
|
+
- probablycorey@gmail.com
|
|
41
|
+
- peter@nulayer.com
|
|
18
42
|
executables: []
|
|
19
43
|
|
|
20
44
|
extensions: []
|
|
21
45
|
|
|
22
|
-
extra_rdoc_files:
|
|
23
|
-
|
|
46
|
+
extra_rdoc_files: []
|
|
47
|
+
|
|
24
48
|
files:
|
|
25
|
-
- .gitignore
|
|
26
|
-
- MIT-LICENSE
|
|
27
49
|
- README.rdoc
|
|
28
|
-
- Rakefile
|
|
29
50
|
- VERSION
|
|
30
|
-
-
|
|
51
|
+
- MIT-LICENSE
|
|
52
|
+
- Rakefile
|
|
53
|
+
- lib/mini_gmagick.rb
|
|
31
54
|
- lib/mini_magick.rb
|
|
32
|
-
- mini_magick.gemspec
|
|
33
55
|
- test/actually_a_gif.jpg
|
|
34
56
|
- test/animation.gif
|
|
35
57
|
- test/command_builder_test.rb
|
|
36
|
-
- test/image_temp_file_test.rb
|
|
37
58
|
- test/image_test.rb
|
|
38
59
|
- test/leaves.tiff
|
|
39
60
|
- test/not_an_image.php
|
|
61
|
+
- test/simple-minus.gif
|
|
40
62
|
- test/simple.gif
|
|
41
63
|
- test/trogdor.jpg
|
|
42
64
|
has_rdoc: true
|
|
43
|
-
homepage: http://github.com/
|
|
65
|
+
homepage: http://github.com/pkieltyka/mini_magick
|
|
66
|
+
licenses: []
|
|
67
|
+
|
|
44
68
|
post_install_message:
|
|
45
|
-
rdoc_options:
|
|
46
|
-
|
|
69
|
+
rdoc_options: []
|
|
70
|
+
|
|
47
71
|
require_paths:
|
|
48
72
|
- lib
|
|
49
73
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
74
|
+
none: false
|
|
50
75
|
requirements:
|
|
51
76
|
- - ">="
|
|
52
77
|
- !ruby/object:Gem::Version
|
|
78
|
+
hash: 3
|
|
79
|
+
segments:
|
|
80
|
+
- 0
|
|
53
81
|
version: "0"
|
|
54
|
-
version:
|
|
55
82
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
83
|
+
none: false
|
|
56
84
|
requirements:
|
|
57
85
|
- - ">="
|
|
58
86
|
- !ruby/object:Gem::Version
|
|
87
|
+
hash: 3
|
|
88
|
+
segments:
|
|
89
|
+
- 0
|
|
59
90
|
version: "0"
|
|
60
|
-
version:
|
|
61
91
|
requirements: []
|
|
62
92
|
|
|
63
|
-
rubyforge_project:
|
|
64
|
-
rubygems_version: 1.3.
|
|
93
|
+
rubyforge_project:
|
|
94
|
+
rubygems_version: 1.3.7
|
|
65
95
|
signing_key:
|
|
66
|
-
specification_version:
|
|
67
|
-
summary: Manipulate images with minimal use of memory
|
|
96
|
+
specification_version: 3
|
|
97
|
+
summary: Manipulate images with minimal use of memory via ImageMagick / GraphicsMagick
|
|
68
98
|
test_files:
|
|
99
|
+
- test/actually_a_gif.jpg
|
|
100
|
+
- test/animation.gif
|
|
69
101
|
- test/command_builder_test.rb
|
|
70
|
-
- test/image_temp_file_test.rb
|
|
71
102
|
- test/image_test.rb
|
|
103
|
+
- test/leaves.tiff
|
|
104
|
+
- test/not_an_image.php
|
|
105
|
+
- test/simple-minus.gif
|
|
106
|
+
- test/simple.gif
|
|
107
|
+
- test/trogdor.jpg
|
data/.gitignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/pkg
|
data/lib/image_temp_file.rb
DELETED
data/mini_magick.gemspec
DELETED
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
# -*- encoding: utf-8 -*-
|
|
2
|
-
|
|
3
|
-
Gem::Specification.new do |s|
|
|
4
|
-
s.name = %q{mini_magick}
|
|
5
|
-
s.version = "1.2.5"
|
|
6
|
-
|
|
7
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
|
8
|
-
s.authors = ["Corey Johnson"]
|
|
9
|
-
s.date = %q{2009-05-27}
|
|
10
|
-
s.email = %q{probablycorey@gmail.com}
|
|
11
|
-
s.extra_rdoc_files = [
|
|
12
|
-
"README.rdoc"
|
|
13
|
-
]
|
|
14
|
-
s.files = [
|
|
15
|
-
".gitignore",
|
|
16
|
-
"MIT-LICENSE",
|
|
17
|
-
"README.rdoc",
|
|
18
|
-
"Rakefile",
|
|
19
|
-
"VERSION",
|
|
20
|
-
"lib/image_temp_file.rb",
|
|
21
|
-
"lib/mini_magick.rb",
|
|
22
|
-
"mini_magick.gemspec",
|
|
23
|
-
"test/actually_a_gif.jpg",
|
|
24
|
-
"test/animation.gif",
|
|
25
|
-
"test/command_builder_test.rb",
|
|
26
|
-
"test/image_temp_file_test.rb",
|
|
27
|
-
"test/image_test.rb",
|
|
28
|
-
"test/leaves.tiff",
|
|
29
|
-
"test/not_an_image.php",
|
|
30
|
-
"test/simple.gif",
|
|
31
|
-
"test/trogdor.jpg"
|
|
32
|
-
]
|
|
33
|
-
s.has_rdoc = true
|
|
34
|
-
s.homepage = %q{http://github.com/probablycorey/mini_magick}
|
|
35
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
|
36
|
-
s.require_paths = ["lib"]
|
|
37
|
-
s.rubyforge_project = %q{mini-magick}
|
|
38
|
-
s.rubygems_version = %q{1.3.1}
|
|
39
|
-
s.summary = %q{Manipulate images with minimal use of memory.}
|
|
40
|
-
s.test_files = [
|
|
41
|
-
"test/command_builder_test.rb",
|
|
42
|
-
"test/image_temp_file_test.rb",
|
|
43
|
-
"test/image_test.rb"
|
|
44
|
-
]
|
|
45
|
-
|
|
46
|
-
if s.respond_to? :specification_version then
|
|
47
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
|
48
|
-
s.specification_version = 2
|
|
49
|
-
|
|
50
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
|
51
|
-
else
|
|
52
|
-
end
|
|
53
|
-
else
|
|
54
|
-
end
|
|
55
|
-
end
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
require 'test/unit'
|
|
2
|
-
require File.join(File.dirname(__FILE__), '../lib/image_temp_file')
|
|
3
|
-
|
|
4
|
-
class ImageTempFileTest < Test::Unit::TestCase
|
|
5
|
-
include MiniMagick
|
|
6
|
-
|
|
7
|
-
def test_multiple_calls_yield_different_files
|
|
8
|
-
first = ImageTempFile.new('test')
|
|
9
|
-
second = ImageTempFile.new('test')
|
|
10
|
-
assert_not_equal first.path, second.path
|
|
11
|
-
end
|
|
12
|
-
|
|
13
|
-
def test_temp_file_has_given_extension
|
|
14
|
-
assert_match /^[^.]+\.jpg$/, ImageTempFile.new('jpg').path
|
|
15
|
-
assert_match /^[^.]+\.png$/, ImageTempFile.new('png').path
|
|
16
|
-
end
|
|
17
|
-
end
|