carrierwave-processing 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/carrierwave-processing/mini_magick.rb +9 -0
- data/lib/carrierwave-processing/rmagick.rb +9 -0
- data/lib/carrierwave-processing/version.rb +1 -1
- data/spec/fixtures/weird_orientation.jpg +0 -0
- data/spec/integration/carrierwave_processing_spec.rb +25 -6
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faf9568b29472a5051a1d6124d706da726808c5a
|
4
|
+
data.tar.gz: 38973be0cb44ff95edb2f866d935a92b20d845c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 349fae360bf7d7ba6aca55a991adc2021b964d595366c278b965e3bdf07d4bb99ad0802e3e6dd712c9fdbda418bab95abf530c3aee533e67340fe1313fd71b26
|
7
|
+
data.tar.gz: 3b115aebf2d68a9b68a341fb41ac3907f6ff9316406dc8e979be49c0c3fcb1c3e414f0d3c27cbe1bce53825855cd9413f24af655f1b9e87e6ddf1d216df6738e
|
data/README.md
CHANGED
@@ -20,7 +20,7 @@ Or install it yourself as:
|
|
20
20
|
|
21
21
|
## Usage
|
22
22
|
|
23
|
-
This gem add several useful methods to CarrierWave processing RMagick and MiniMagick modules: `quality` and `
|
23
|
+
This gem add several useful methods to CarrierWave processing RMagick and MiniMagick modules: `quality`, `strip`, `blur` and `colorspace`.
|
24
24
|
To use those, you should include specified module (RMagick or MiniMagick) into your uploader and use processors:
|
25
25
|
|
26
26
|
class AvatarUploader < CarrierWave::Uploader::Base
|
Binary file
|
@@ -76,6 +76,22 @@ working_module_names.each do |module_name|
|
|
76
76
|
|
77
77
|
expect(File.size(uploader.store_path)).to be < File.size(fixture_path('little_foxes.jpg'))
|
78
78
|
end
|
79
|
+
|
80
|
+
it 'auto-orients the image' do
|
81
|
+
uploader = uploader_for(module_name) {
|
82
|
+
process :auto_orient
|
83
|
+
}
|
84
|
+
|
85
|
+
open_fixture 'weird_orientation.jpg' do |file|
|
86
|
+
uploader.store!(file)
|
87
|
+
end
|
88
|
+
|
89
|
+
modified_orientation = exif(uploader.store_path, 'Orientation')
|
90
|
+
original_orientation = exif(fixture_path('weird_orientation.jpg'), 'Orientation')
|
91
|
+
|
92
|
+
expect(modified_orientation).to eq('1')
|
93
|
+
expect(modified_orientation).not_to eq(original_orientation)
|
94
|
+
end
|
79
95
|
end
|
80
96
|
end
|
81
97
|
|
@@ -91,16 +107,19 @@ describe CarrierWave::Processing do
|
|
91
107
|
process :quality => 90
|
92
108
|
process :blur => [0, 2]
|
93
109
|
process :colorspace => :cmyk
|
110
|
+
process :auto_orient
|
94
111
|
}
|
95
112
|
}
|
96
113
|
|
97
|
-
|
98
|
-
|
99
|
-
|
114
|
+
['little_foxes.jpg', 'weird_orientation.jpg'].each do |test_filename|
|
115
|
+
uploaders.each do |uploader|
|
116
|
+
open_fixture test_filename do |file|
|
117
|
+
uploader.store!(file)
|
118
|
+
end
|
100
119
|
end
|
101
|
-
end
|
102
120
|
|
103
|
-
|
104
|
-
|
121
|
+
files = uploaders.map { |uploader| File.open(uploader.store_path, 'rb', &:read) }
|
122
|
+
expect(files).to be_all { |file| file == files[0] }
|
123
|
+
end
|
105
124
|
end
|
106
125
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carrierwave-processing
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Forkert
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carrierwave
|
@@ -101,6 +101,7 @@ files:
|
|
101
101
|
- lib/carrierwave-processing/version.rb
|
102
102
|
- spec/fixtures/little_foxes.jpg
|
103
103
|
- spec/fixtures/little_foxes_cmyk.jpg
|
104
|
+
- spec/fixtures/weird_orientation.jpg
|
104
105
|
- spec/integration/carrierwave_processing_spec.rb
|
105
106
|
- spec/spec_helper.rb
|
106
107
|
homepage: https://github.com/fxposter/carrierwave-processing
|
@@ -122,13 +123,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
122
123
|
version: '0'
|
123
124
|
requirements: []
|
124
125
|
rubyforge_project:
|
125
|
-
rubygems_version: 2.2.
|
126
|
+
rubygems_version: 2.2.2
|
126
127
|
signing_key:
|
127
128
|
specification_version: 4
|
128
129
|
summary: Additional processing support for MiniMagick and RMagick
|
129
130
|
test_files:
|
130
131
|
- spec/fixtures/little_foxes.jpg
|
131
132
|
- spec/fixtures/little_foxes_cmyk.jpg
|
133
|
+
- spec/fixtures/weird_orientation.jpg
|
132
134
|
- spec/integration/carrierwave_processing_spec.rb
|
133
135
|
- spec/spec_helper.rb
|
134
|
-
has_rdoc:
|