attachment_on_the_fly 0.1.0 → 0.1.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/VERSION +1 -1
- data/lib/attachment_on_the_fly.rb +10 -3
- metadata +2 -2
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.1
|
@@ -79,20 +79,27 @@ Paperclip::Attachment.class_eval do
|
|
79
79
|
return new_path
|
80
80
|
end
|
81
81
|
|
82
|
+
command = ""
|
83
|
+
|
82
84
|
if kind == "height"
|
83
85
|
# resize_image infilename, outfilename , 0, height
|
84
86
|
command = "#{convert_command_path}convert -colorspace RGB -geometry x#{height} -quality 100 -sharpen 1 #{original} #{newfilename} 2>&1 > /dev/null"
|
85
|
-
`#{command}`
|
86
87
|
elsif kind == "width"
|
87
88
|
# resize_image infilename, outfilename, width
|
88
89
|
command = "#{convert_command_path}convert -colorspace RGB -geometry #{width} -quality 100 -sharpen 1 #{original} #{newfilename} 2>&1 > /dev/null"
|
89
|
-
`#{command}`
|
90
90
|
elsif kind == "both"
|
91
91
|
# resize_image infilename, outfilename, height, width
|
92
92
|
command = "#{convert_command_path}convert -colorspace RGB -geometry #{width}x#{height} -quality 100 -sharpen 1 #{original} #{newfilename} 2>&1 > /dev/null"
|
93
|
-
|
93
|
+
end
|
94
|
+
|
95
|
+
`#{command}`
|
96
|
+
|
97
|
+
if $? != 0
|
98
|
+
raise AttachmentOnTheFlyError.new("Execution of convert failed")
|
94
99
|
end
|
95
100
|
|
96
101
|
return new_path
|
97
102
|
end
|
98
103
|
end
|
104
|
+
|
105
|
+
class AttachmentOnTheFlyError < StandardError; end
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: attachment_on_the_fly
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 0.1.
|
5
|
+
version: 0.1.1
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Jeff Sutherland
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2011-02-
|
13
|
+
date: 2011-02-18 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|