carrierwave-imageoptimizer 1.1.1 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/.travis.yml +9 -1
- data/README.md +15 -1
- data/lib/carrierwave-imageoptimizer.rb +2 -2
- data/lib/carrierwave-imageoptimizer/version.rb +1 -1
- data/spec/carrierwave-imageoptimizer/version_spec.rb +2 -2
- data/spec/carrierwave_imageoptimizer_spec.rb +9 -2
- metadata +1 -1
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YjU2OWI2OTU1NjZhYTg4MWUzMmMzOGQzZDdjODc4YWU4MTI0ZTY4Yw==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YTEyNGQxNTI2ZjJjYWNmNTQzY2M5NDg5M2U1ZDFkODYxMzI3MDhiYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NmUwNWYwZjlkYTk1ODk2NDU2NWIyNDg2MGFkM2UzZjY2NmE3NWE4NTljNjYx
|
10
|
+
NTAwNGU4YzViNzEzYzZiNTk5MTQwZjlkMjZiMTk3NjQyZjVlYmUyZGY3YWYz
|
11
|
+
NWZjNDZmZmRkOWFjNmJiNWNiODc0NTAwZWYyYjRhZGM0OTJjOTg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTFjMTcyNDdiMWM2MzUzNTg5MDdmY2U3NTQ1N2ExN2Y1ZDNhZDkyMDYzYjMz
|
14
|
+
Y2M4ZmVlYjE3YWMxMDhkMDFjOTc3YzFmNTI5YmIzZWJjNTM5OTEzYTAzY2Nl
|
15
|
+
YWFlZjNkZTNkN2ZiMzkxY2Y5OTliNjgzNTY2ZWQ0NGY4ZWFmOTI=
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
This gem allows you to simply optimize CarrierWave images via jpegoptim or optipng using the image_optimizer gem.
|
4
4
|
|
5
|
-
Tested against 1.9.3, 2.0.0, ruby-head, jruby-19mode, jruby-head, and rbx-
|
5
|
+
Tested against 1.9.3, 2.0.0, ruby-head, jruby-19mode, jruby-head, rbx-2.1.1, rbx-2.2.0, and rbx-2.2.1
|
6
6
|
|
7
7
|
[![Build Status](https://secure.travis-ci.org/jtescher/carrierwave-imageoptimizer.png)]
|
8
8
|
(http://travis-ci.org/jtescher/carrierwave-imageoptimizer)
|
@@ -71,6 +71,20 @@ class MyUploader < CarrierWave::Uploader::Base
|
|
71
71
|
end
|
72
72
|
```
|
73
73
|
|
74
|
+
##### Lossy JPEG optimization
|
75
|
+
|
76
|
+
Pass an optional `quality` parameter to target a specific lossy JPG quality level (0-100), default is lossless
|
77
|
+
optimization. PNGs will ignore the quality setting.
|
78
|
+
|
79
|
+
```ruby
|
80
|
+
class MyUploader < CarrierWave::Uploader::Base
|
81
|
+
...
|
82
|
+
version :thumbnail do
|
83
|
+
process :optimize, quality: 50
|
84
|
+
end
|
85
|
+
end
|
86
|
+
```
|
87
|
+
|
74
88
|
## Contributing
|
75
89
|
|
76
90
|
1. Fork it
|
@@ -11,9 +11,16 @@ describe CarrierWave::ImageOptimizer do
|
|
11
11
|
|
12
12
|
it 'delegates to a new instance of ImageOptimizer with the current path to the file' do
|
13
13
|
image_optimizer = double(::ImageOptimizer)
|
14
|
-
::ImageOptimizer.
|
15
|
-
image_optimizer.
|
14
|
+
expect(::ImageOptimizer).to receive(:new).with('/tmp/path/to/image.jpg', {}).and_return(image_optimizer)
|
15
|
+
expect(image_optimizer).to receive(:optimize)
|
16
16
|
@uploader.new.optimize
|
17
17
|
end
|
18
|
+
|
19
|
+
it 'accepts an optional quality param to target a specific lossy JPG quality level ' do
|
20
|
+
image_optimizer = double(::ImageOptimizer)
|
21
|
+
expect(::ImageOptimizer).to receive(:new).with('/tmp/path/to/image.jpg', quality: 99).and_return(image_optimizer)
|
22
|
+
expect(image_optimizer).to receive(:optimize)
|
23
|
+
@uploader.new.optimize(quality: 99)
|
24
|
+
end
|
18
25
|
end
|
19
26
|
end
|
metadata
CHANGED
metadata.gz.sig
CHANGED
Binary file
|