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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 692153452bc341564f11b2a70cdbc033c160fdd7
4
- data.tar.gz: 9e60ff3332b29d57d6300750602bbcc5c94bba41
3
+ metadata.gz: faf9568b29472a5051a1d6124d706da726808c5a
4
+ data.tar.gz: 38973be0cb44ff95edb2f866d935a92b20d845c5
5
5
  SHA512:
6
- metadata.gz: 8956fa5709c9c8aab3bed8c7dfc7e269b8ce4f253ff6b22bdb25aacf6af5ab48d2813d2e5eabdb52f91b975b95cc83e748f844d9c655fb683eab38972e63f964
7
- data.tar.gz: 1d89786ba670ff71e99facdd6178a4139c939e6e3b445fb0a277ee28f00aa4ac89f1949c4ab9da9558b4da1c74994a96c48e0b75801350a4a2ab5a986e799daa
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 `strip`.
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
@@ -57,6 +57,15 @@ module CarrierWave
57
57
  end
58
58
  end
59
59
 
60
+ # Auto-orients the image
61
+ #
62
+ # process :auto_orient
63
+ def auto_orient
64
+ manipulate! do |img|
65
+ img.auto_orient
66
+ img
67
+ end
68
+ end
60
69
  end
61
70
  end
62
71
  end
@@ -56,6 +56,15 @@ module CarrierWave
56
56
  end
57
57
  end
58
58
 
59
+ # Auto-orients the image
60
+ #
61
+ # process :auto_orient
62
+ def auto_orient
63
+ manipulate! do |img|
64
+ img.auto_orient!
65
+ img
66
+ end
67
+ end
59
68
  end
60
69
  end
61
70
  end
@@ -1,5 +1,5 @@
1
1
  module CarrierWave
2
2
  module Processing
3
- VERSION = '1.0.0'
3
+ VERSION = '1.1.0'
4
4
  end
5
5
  end
@@ -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
- uploaders.each do |uploader|
98
- open_fixture 'little_foxes.jpg' do |file|
99
- uploader.store!(file)
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
- files = uploaders.map { |uploader| File.open(uploader.store_path, 'rb', &:read) }
104
- expect(files).to be_all { |file| file == files[0] }
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.0.0
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-01-21 00:00:00.000000000 Z
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.1
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: