carrierwave_imagevoodoo 0.0.7-java → 0.0.8-java

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 158f0f3c812b06f9deb873a78a025c85bd6588da
4
- data.tar.gz: a173c5cfb274dc619d0f5167790bd029da4f0210
3
+ metadata.gz: 2b8e5a75e1b5c3586616f8be92c6fa5ce4d5bee7
4
+ data.tar.gz: 3bbec9686b8098d55d7c6b1c0bfc5b67fb45e99f
5
5
  SHA512:
6
- metadata.gz: 9a98ca2aec9916c7bcb4236fa51b70756a6bcaef32a4ab3700816cd7ac8d955ec43d4b09079bf02521b70553a7e67ab0fbe7d6b87e4886d8bcbb2959c4f3a622
7
- data.tar.gz: cb223102fd73b4266cc7735a5f405792362745faca80dd963e6e0391bf905e6e1cb2a0a87f40df8bf49fbba126cdc0afc46faba3347689b9880fe2b211ab5739
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.save "#{current_path.chomp(File.extname(current_path))}.#{format}"
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.save current_path
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.save current_path
156
+ save_image img, current_path
141
157
  end
142
158
  end
143
159
  end
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module ImageVoodoo
3
- VERSION = "0.0.7"
3
+ VERSION = "0.0.8"
4
4
  end
5
5
  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.7
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-18 00:00:00.000000000 Z
11
+ date: 2013-11-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: carrierwave