carrierwave_imagevoodoo 0.0.6-java → 0.0.7-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbb670cc2a2874d8b089f135dca8e605195d2c69
4
- data.tar.gz: d58a142b36032aa835baf4b41448c0aae4f20716
3
+ metadata.gz: 158f0f3c812b06f9deb873a78a025c85bd6588da
4
+ data.tar.gz: a173c5cfb274dc619d0f5167790bd029da4f0210
5
5
  SHA512:
6
- metadata.gz: c2f317a9d17fcc1dd2d6905b0be3f766fedbb53898b45e009d0f0d281364a3d2ef3590b2f2655aad2338f736336255d55fef037d61e796919cca0d1a8f843658
7
- data.tar.gz: 0fbfc65faadfdb3fa728a31a4ba74aa52ddbf2b514dbbfa406e3ac883dad1fb57bddefc107826ba422086e29487961d57f79891e15da5f7cfd448b41dcb5e647
6
+ metadata.gz: 9a98ca2aec9916c7bcb4236fa51b70756a6bcaef32a4ab3700816cd7ac8d955ec43d4b09079bf02521b70553a7e67ab0fbe7d6b87e4886d8bcbb2959c4f3a622
7
+ data.tar.gz: cb223102fd73b4266cc7735a5f405792362745faca80dd963e6e0391bf905e6e1cb2a0a87f40df8bf49fbba126cdc0afc46faba3347689b9880fe2b211ab5739
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module ImageVoodoo
3
- VERSION = "0.0.6"
3
+ VERSION = "0.0.7"
4
4
  end
5
5
  end
@@ -32,9 +32,7 @@ module CarrierWave
32
32
  manipulate! do |image|
33
33
  yield(image) if block_given?
34
34
 
35
- image.save_impl format, Java::JavaIo::File.new(
36
- "#{current_path.chomp(File.extname(current_path))}.#{format}"
37
- )
35
+ image.save "#{current_path.chomp(File.extname(current_path))}.#{format}"
38
36
  end
39
37
  end
40
38
 
@@ -81,7 +79,7 @@ module CarrierWave
81
79
  end
82
80
 
83
81
  i2.with_crop( x_offset, y_offset, new_width + x_offset, new_height + y_offset) do |file|
84
- file.save_impl format, Java::JavaIo::File.new(current_path)
82
+ file.save current_path
85
83
  end
86
84
  end
87
85
  end
@@ -122,19 +120,11 @@ module CarrierWave
122
120
  #end
123
121
 
124
122
  def image_voodoo_image
125
- ::ImageVoodoo.with_bytes File.read(current_path)
126
- end
127
-
128
- def format
129
- format = if respond_to? :filename
130
- File.extname filename
131
- else
132
- File.extname current_path
123
+ if file.respond_to? :rewind
124
+ file.rewind
133
125
  end
134
126
 
135
- if format.size > 0
136
- format[1..-1]
137
- end
127
+ ::ImageVoodoo.with_bytes file.read
138
128
  end
139
129
 
140
130
  def manipulate!
@@ -147,7 +137,7 @@ module CarrierWave
147
137
  ratio = [w_ratio, h_ratio].min
148
138
 
149
139
  image.scale(ratio) do |img|
150
- img.save_impl format, Java::JavaIo::File.new(current_path)
140
+ img.save current_path
151
141
  end
152
142
  end
153
143
  end
@@ -2,7 +2,7 @@ require "spec_helper"
2
2
 
3
3
  describe CarrierWave::ImageVoodoo do
4
4
  let :klass do
5
- Class.new do
5
+ Class.new(CarrierWave::Uploader::Base) do
6
6
  include CarrierWave::ImageVoodoo
7
7
  end
8
8
  end
@@ -13,7 +13,7 @@ describe CarrierWave::ImageVoodoo do
13
13
 
14
14
  before do
15
15
  FileUtils.cp(file_path("cat.jpg"), file_path("cat_copy.jpg"))
16
- subject.stub(:file).and_return(File.new(file_path("cat_copy.jpg")))
16
+ subject.stub(:file).and_return(CarrierWave::SanitizedFile.new(file_path("cat_copy.jpg")))
17
17
  subject.stub(:current_path).and_return(file_path("cat_copy.jpg"))
18
18
  subject.stub(:cached?).and_return true
19
19
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: carrierwave_imagevoodoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: java
6
6
  authors:
7
7
  - Tasveer Singh