kelredd-pruview 0.2.0 → 0.2.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.
Potentially problematic release.
This version of kelredd-pruview might be problematic. Click here for more details.
- data/Rakefile +1 -1
- data/lib/pruview/document.rb +3 -3
- data/lib/pruview/version.rb +1 -1
- data/test/files/image.tiff +0 -0
- data/test/helper.rb +2 -1
- data/test/unit/document_test.rb +13 -1
- metadata +8 -7
data/Rakefile
CHANGED
@@ -24,7 +24,7 @@ spec = Gem::Specification.new do |s|
|
|
24
24
|
s.add_development_dependency("kelredd-useful", [">= 0.4.0"])
|
25
25
|
s.add_development_dependency("kelredd-simple-gem", [">= 0.7.0"])
|
26
26
|
|
27
|
-
s.add_dependency('mini_magick', "~>2.
|
27
|
+
s.add_dependency('mini_magick', "~>2.3")
|
28
28
|
s.add_dependency('flvtool2')
|
29
29
|
end
|
30
30
|
|
data/lib/pruview/document.rb
CHANGED
@@ -53,7 +53,7 @@ module Pruview
|
|
53
53
|
def get_image(source)
|
54
54
|
source = get_postscript_source(source) if format_postscript?(source)
|
55
55
|
begin
|
56
|
-
return MiniMagick::Image.
|
56
|
+
return MiniMagick::Image.open(source)
|
57
57
|
rescue Exception => err
|
58
58
|
raise "Error reading source image: #{err.message}"
|
59
59
|
end
|
@@ -91,7 +91,7 @@ module Pruview
|
|
91
91
|
|
92
92
|
def scale_image(width, height, crop = false)
|
93
93
|
begin
|
94
|
-
image = MiniMagick::Image.
|
94
|
+
image = MiniMagick::Image.open(@image.path)
|
95
95
|
crop_image(image, crop)
|
96
96
|
image.resize "#{width}x#{height}" if crop || @image[:width].to_i > width || @image[:height] > height
|
97
97
|
return image
|
@@ -138,7 +138,7 @@ module Pruview
|
|
138
138
|
|
139
139
|
Document::PSD_EXT = '.psd'
|
140
140
|
Document::POSTSCRIPT_EXT = ['.pdf', '.eps', '.ai']
|
141
|
-
Document::IMAGE_EXT = ['.bmp', '.gif', '.jpg', '.jpeg', '.png', '.tga']
|
141
|
+
Document::IMAGE_EXT = ['.bmp', '.gif', '.jpg', '.jpeg', '.png', '.tga', '.tif', '.tiff']
|
142
142
|
|
143
143
|
end
|
144
144
|
|
data/lib/pruview/version.rb
CHANGED
Binary file
|
data/test/helper.rb
CHANGED
@@ -24,7 +24,8 @@ FILES = {
|
|
24
24
|
'basic video' => "./test/files/basic.mpg",
|
25
25
|
'invalid video' => "./test/files/invalid.mov",
|
26
26
|
'error video' => "./test/files/error.mov",
|
27
|
-
'invalid format' => "./test/files/invalid_format.poop"
|
27
|
+
'invalid format' => "./test/files/invalid_format.poop",
|
28
|
+
'tiff' => "./test/files/image.tiff"
|
28
29
|
}
|
29
30
|
|
30
31
|
FileUtils.mkdir_p File.expand_path(FILES_PATH) unless File.exists? File.expand_path(FILES_PATH)
|
data/test/unit/document_test.rb
CHANGED
@@ -20,11 +20,23 @@ module Pruview
|
|
20
20
|
end
|
21
21
|
|
22
22
|
should "create a jpg version of itself" do
|
23
|
-
@output = @file.to_jpg('
|
23
|
+
@output = @file.to_jpg('basic_image', 50, 50)
|
24
24
|
assert File.exists?(@output)
|
25
25
|
assert_equal '.jpg', File.extname(@output)
|
26
26
|
end
|
27
27
|
|
28
|
+
context "of a TIFF file" do
|
29
|
+
setup { @file = Pruview::Document.new(FILES['tiff'], OUTPUT_PATH) }
|
30
|
+
subject { @file }
|
31
|
+
|
32
|
+
should "create a jpg version of itself" do
|
33
|
+
@output = @file.to_jpg('tiff', 50, 50)
|
34
|
+
assert File.exists?(@output)
|
35
|
+
assert_equal '.jpg', File.extname(@output)
|
36
|
+
end
|
37
|
+
|
38
|
+
end
|
39
|
+
|
28
40
|
end
|
29
41
|
|
30
42
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kelredd-pruview
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 1
|
10
|
+
version: 0.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Kelly Redding
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-10-28 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -90,11 +90,11 @@ dependencies:
|
|
90
90
|
requirements:
|
91
91
|
- - ~>
|
92
92
|
- !ruby/object:Gem::Version
|
93
|
-
hash:
|
93
|
+
hash: 5
|
94
94
|
segments:
|
95
95
|
- 2
|
96
|
-
-
|
97
|
-
version: "2.
|
96
|
+
- 3
|
97
|
+
version: "2.3"
|
98
98
|
type: :runtime
|
99
99
|
version_requirements: *id005
|
100
100
|
- !ruby/object:Gem::Dependency
|
@@ -135,6 +135,7 @@ files:
|
|
135
135
|
- test/files/basic.mpg
|
136
136
|
- test/files/error.jpg
|
137
137
|
- test/files/error.mov
|
138
|
+
- test/files/image.tiff
|
138
139
|
- test/files/invalid_format.poop
|
139
140
|
- test/helper.rb
|
140
141
|
- test/unit/document_test.rb
|