mini_magick 1.2.0 → 1.2.3
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/History.txt +11 -0
- data/Manifest.txt +14 -0
- data/{README → README.txt} +41 -12
- data/Rakefile +15 -66
- data/init.rb +2 -0
- data/lib/image_temp_file.rb +13 -0
- data/lib/mini_magick.rb +72 -66
- data/test/not_an_image.php +420 -420
- data/test/test_image_temp_file.rb +14 -0
- data/test/{mini_magick_test.rb → test_mini_magick_test.rb} +8 -0
- metadata +38 -20
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
require 'test/unit'
|
|
2
|
+
require File.join(File.dirname(__FILE__), '../lib/image_temp_file')
|
|
3
|
+
|
|
4
|
+
class ImageTest < Test::Unit::TestCase
|
|
5
|
+
include MiniMagick
|
|
6
|
+
|
|
7
|
+
def test_image_temp_file
|
|
8
|
+
tmp = ImageTempFile.new('test')
|
|
9
|
+
assert_match %r{^test}, File::basename(tmp.path)
|
|
10
|
+
tmp = ImageTempFile.new('test.jpg')
|
|
11
|
+
assert_match %r{^test}, File::basename(tmp.path)
|
|
12
|
+
assert_match %r{\.jpg$}, File::basename(tmp.path)
|
|
13
|
+
end
|
|
14
|
+
end
|
|
@@ -7,6 +7,7 @@ class ImageTest < Test::Unit::TestCase
|
|
|
7
7
|
CURRENT_DIR = File.dirname(File.expand_path(__FILE__)) + "/"
|
|
8
8
|
|
|
9
9
|
SIMPLE_IMAGE_PATH = CURRENT_DIR + "simple.gif"
|
|
10
|
+
TIFF_IMAGE_PATH = CURRENT_DIR + "burner.tiff"
|
|
10
11
|
NOT_AN_IMAGE_PATH = CURRENT_DIR + "not_an_image.php"
|
|
11
12
|
GIF_WITH_JPG_EXT = CURRENT_DIR + "actually_a_gif.jpg"
|
|
12
13
|
EXIF_IMAGE_PATH = CURRENT_DIR + "trogdor.jpg"
|
|
@@ -49,6 +50,13 @@ class ImageTest < Test::Unit::TestCase
|
|
|
49
50
|
assert_equal 55, image[:height]
|
|
50
51
|
assert_match(/^gif$/i, image[:format])
|
|
51
52
|
end
|
|
53
|
+
|
|
54
|
+
def test_tiff
|
|
55
|
+
image = Image.new(TIFF_IMAGE_PATH)
|
|
56
|
+
assert_equal "tiff", image[:format].downcase
|
|
57
|
+
assert_equal 317, image[:width]
|
|
58
|
+
assert_equal 275, image[:height]
|
|
59
|
+
end
|
|
52
60
|
|
|
53
61
|
def test_gif_with_jpg_format
|
|
54
62
|
image = Image.new(GIF_WITH_JPG_EXT)
|
metadata
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
|
-
rubygems_version: 0.
|
|
2
|
+
rubygems_version: 0.9.0.1
|
|
3
3
|
specification_version: 1
|
|
4
4
|
name: mini_magick
|
|
5
5
|
version: !ruby/object:Gem::Version
|
|
6
|
-
version: 1.2.
|
|
7
|
-
date:
|
|
8
|
-
summary:
|
|
6
|
+
version: 1.2.3
|
|
7
|
+
date: 2007-06-15 00:00:00 -04:00
|
|
8
|
+
summary: A simple image manipulation library based on ImageMagick.
|
|
9
9
|
require_paths:
|
|
10
10
|
- lib
|
|
11
|
-
email: probablycorey@gmail.com
|
|
12
|
-
homepage: http://
|
|
11
|
+
email: probablycorey+ruby@gmail.com
|
|
12
|
+
homepage: http://www.zenspider.com/ZSS/Products/mini_magick/
|
|
13
13
|
rubyforge_project: mini_magick
|
|
14
|
-
description:
|
|
15
|
-
autorequire:
|
|
14
|
+
description: "- Why? I was using RMagick and loving it, but it was eating up huge amounts of memory. A simple script like this... Magick::read(\"image.jpg\") do |f| f.write(\"manipulated.jpg\") end ...would use over 100 Megs of Ram. On my local machine this wasn't a problem, but on my hosting server the ruby apps would crash because of their 100 Meg memory limit."
|
|
15
|
+
autorequire:
|
|
16
16
|
default_executable:
|
|
17
17
|
bindir: bin
|
|
18
18
|
has_rdoc: true
|
|
@@ -25,29 +25,47 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
|
|
|
25
25
|
platform: ruby
|
|
26
26
|
signing_key:
|
|
27
27
|
cert_chain:
|
|
28
|
+
post_install_message:
|
|
28
29
|
authors:
|
|
29
30
|
- Corey Johnson
|
|
30
31
|
files:
|
|
31
|
-
- Rakefile
|
|
32
|
-
- README
|
|
33
32
|
- MIT-LICENSE
|
|
33
|
+
- History.txt
|
|
34
|
+
- Manifest.txt
|
|
35
|
+
- README.txt
|
|
36
|
+
- Rakefile
|
|
37
|
+
- init.rb
|
|
38
|
+
- lib/image_temp_file.rb
|
|
34
39
|
- lib/mini_magick.rb
|
|
35
40
|
- test/actually_a_gif.jpg
|
|
36
|
-
- test/mini_magick_test.rb
|
|
37
41
|
- test/not_an_image.php
|
|
38
42
|
- test/simple.gif
|
|
43
|
+
- test/test_image_temp_file.rb
|
|
44
|
+
- test/test_mini_magick_test.rb
|
|
39
45
|
- test/trogdor.jpg
|
|
40
|
-
test_files:
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
test_files:
|
|
47
|
+
- test/test_image_temp_file.rb
|
|
48
|
+
- test/test_mini_magick_test.rb
|
|
49
|
+
rdoc_options:
|
|
50
|
+
- --main
|
|
51
|
+
- README.txt
|
|
52
|
+
extra_rdoc_files:
|
|
53
|
+
- History.txt
|
|
54
|
+
- Manifest.txt
|
|
55
|
+
- README.txt
|
|
46
56
|
executables: []
|
|
47
57
|
|
|
48
58
|
extensions: []
|
|
49
59
|
|
|
50
|
-
requirements:
|
|
51
|
-
- none
|
|
52
|
-
dependencies: []
|
|
60
|
+
requirements: []
|
|
53
61
|
|
|
62
|
+
dependencies:
|
|
63
|
+
- !ruby/object:Gem::Dependency
|
|
64
|
+
name: hoe
|
|
65
|
+
version_requirement:
|
|
66
|
+
version_requirements: !ruby/object:Gem::Version::Requirement
|
|
67
|
+
requirements:
|
|
68
|
+
- - ">="
|
|
69
|
+
- !ruby/object:Gem::Version
|
|
70
|
+
version: 1.2.1
|
|
71
|
+
version:
|