carrierwave_imagevoodoo 0.0.7-java → 0.0.8-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/carrierwave_imagevoodoo.rb +19 -3
- data/lib/carrierwave_imagevoodoo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b8e5a75e1b5c3586616f8be92c6fa5ce4d5bee7
|
4
|
+
data.tar.gz: 3bbec9686b8098d55d7c6b1c0bfc5b67fb45e99f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6d75623b666f1f01faca4d4a91010eee42c93d2aa88a98e107afabf41908474cdb3e109f1e854daa3084250d4f0be29e3df0d236cd668017669b378293e721a
|
7
|
+
data.tar.gz: bdea5ac4db56967af23796e67ddb3bf58ff39cd97c7e43c2e1892a4e9aff8982b25117cc0fc4a75caf21f7711255842643edda070662ca5fadcac5e73e283757
|
@@ -30,9 +30,11 @@ module CarrierWave
|
|
30
30
|
|
31
31
|
def convert format
|
32
32
|
manipulate! do |image|
|
33
|
+
@format = format
|
34
|
+
|
33
35
|
yield(image) if block_given?
|
34
36
|
|
35
|
-
image
|
37
|
+
save_image image, "#{current_path.chomp(File.extname(current_path))}.#{format}"
|
36
38
|
end
|
37
39
|
end
|
38
40
|
|
@@ -79,7 +81,7 @@ module CarrierWave
|
|
79
81
|
end
|
80
82
|
|
81
83
|
i2.with_crop( x_offset, y_offset, new_width + x_offset, new_height + y_offset) do |file|
|
82
|
-
file
|
84
|
+
save_image file, current_path
|
83
85
|
end
|
84
86
|
end
|
85
87
|
end
|
@@ -127,6 +129,20 @@ module CarrierWave
|
|
127
129
|
::ImageVoodoo.with_bytes file.read
|
128
130
|
end
|
129
131
|
|
132
|
+
def save_image image, path
|
133
|
+
format = if @format
|
134
|
+
@format
|
135
|
+
else
|
136
|
+
format = File.extname path
|
137
|
+
|
138
|
+
if format
|
139
|
+
format[1..-1]
|
140
|
+
end
|
141
|
+
end
|
142
|
+
|
143
|
+
image.save_impl format, Java::JavaIo::File.new(path)
|
144
|
+
end
|
145
|
+
|
130
146
|
def manipulate!
|
131
147
|
yield image_voodoo_image
|
132
148
|
end
|
@@ -137,7 +153,7 @@ module CarrierWave
|
|
137
153
|
ratio = [w_ratio, h_ratio].min
|
138
154
|
|
139
155
|
image.scale(ratio) do |img|
|
140
|
-
img
|
156
|
+
save_image img, current_path
|
141
157
|
end
|
142
158
|
end
|
143
159
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave_imagevoodoo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Tasveer Singh
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|