piet 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- piet (0.1.1)
4
+ piet (0.1.2)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
data/README.md CHANGED
@@ -29,11 +29,15 @@ Usage
29
29
 
30
30
  You simply require the gem
31
31
 
32
- require 'piet'
32
+ ```ruby
33
+ require 'piet'
34
+ ```
33
35
 
34
36
  and then call the **optimize** method:
35
37
 
36
- Piet.optimize(path, opts)
38
+ ```ruby
39
+ Piet.optimize(path, opts)
40
+ ```
37
41
 
38
42
  The options are:
39
43
 
@@ -48,53 +52,61 @@ This way, you can optimize the original image or a version.
48
52
 
49
53
  In order to do that, firstly add **piet** to your Gemfile:
50
54
 
51
- gem 'piet'
55
+ ```ruby
56
+ gem 'piet'
57
+ ```
52
58
 
53
59
  Then go to your CarrierWave uploader and include Piet's extension:
54
60
 
55
- class ImageUploader < CarrierWave::Uploader::Base
56
- ...
57
- include Piet::CarrierWaveExtension
58
- ...
59
- end
61
+ ```ruby
62
+ class ImageUploader < CarrierWave::Uploader::Base
63
+ ...
64
+ include Piet::CarrierWaveExtension
65
+ ...
66
+ end
67
+ ```
60
68
 
61
69
  And finally use Piet! For all the images:
62
70
 
63
- class ImageUploader < CarrierWave::Uploader::Base
64
- ...
65
- process :optimize
66
- ...
67
- end
71
+ ```ruby
72
+ class ImageUploader < CarrierWave::Uploader::Base
73
+ ...
74
+ process :optimize
75
+ ...
76
+ end
77
+ ```
68
78
 
69
79
  Or only for a version:
70
80
 
71
- class ImageUploader < CarrierWave::Uploader::Base
72
- ...
73
- version :normal do
74
- ...
75
- process :optimize
76
- end
77
- ...
78
- end
81
+ ```ruby
82
+ class ImageUploader < CarrierWave::Uploader::Base
83
+ ...
84
+ version :normal do
85
+ ...
86
+ process :optimize
87
+ end
88
+ ...
89
+ end
90
+ ```
79
91
 
80
92
  Examples
81
93
  --------
82
94
 
83
95
  * Simply Optimizing
84
96
 
85
- ```
86
- Piet.optimize('/my/wonderful/pics/piggy.png')
97
+ ```ruby
98
+ Piet.optimize('/my/wonderful/pics/piggy.png')
87
99
 
88
- Piet.optimize('/my/wonderful/pics/pony.jpg')
89
- ```
100
+ Piet.optimize('/my/wonderful/pics/pony.jpg')
101
+ ```
90
102
 
91
103
  would optimize those PNG, GIF and JPEG files but ouput nothing.
92
104
 
93
105
  * Optimizing PNG/GIF and getting feedback
94
106
 
95
- ```
96
- Piet.optimize('/my/wonderful/pics/piggy.png', :verbose => true)
97
- ```
107
+ ```ruby
108
+ Piet.optimize('/my/wonderful/pics/piggy.png', :verbose => true)
109
+ ```
98
110
 
99
111
  would optimize that PNG/GIF file and ouput something similar to this one:
100
112
 
@@ -104,20 +116,20 @@ would optimize that PNG/GIF file and ouput something similar to this one:
104
116
  Input file size = 157426 bytes
105
117
 
106
118
  Trying:
107
- zc = 9 zm = 9 zs = 0 f = 1 IDAT size = 156966
108
- zc = 9 zm = 8 zs = 0 f = 1 IDAT size = 156932
119
+ zc = 9 zm = 9 zs = 0 f = 1 IDAT size = 156966
120
+ zc = 9 zm = 8 zs = 0 f = 1 IDAT size = 156932
109
121
 
110
122
  Selecting parameters:
111
- zc = 9 zm = 8 zs = 0 f = 1 IDAT size = 156932
123
+ zc = 9 zm = 8 zs = 0 f = 1 IDAT size = 156932
112
124
 
113
125
  Output IDAT size = 156932 bytes (437 bytes decrease)
114
126
  Output file size = 156989 bytes (437 bytes = 0.28% decrease)
115
127
 
116
128
  * Optimizing JPEG and getting feedback
117
129
 
118
- ```
119
- Piet.optimize('/my/wonderful/pics/pony.jpg', :verbose => true)
120
- ```
130
+ ```ruby
131
+ Piet.optimize('/my/wonderful/pics/pony.jpg', :verbose => true)
132
+ ```
121
133
 
122
134
  would optimize that JPEG file and ouput similar to this one:
123
135
 
@@ -134,3 +146,4 @@ Changelog
134
146
 
135
147
  * v.0.1.0 Optimization of PNGs and JPEGs, including an integration with Carrierwave
136
148
  * v.0.1.1 Added support for GIFs. Added an extra option to use pngquant (thanks @rogercampos). Solved problems with Carrierwave >= 0.6 (thanks @mllocs and @huacnlee).
149
+ * v.0.1.2 Fixed some problems with missing processing, thanks to @lentg.
@@ -2,7 +2,7 @@ module Piet
2
2
  module CarrierWaveExtension
3
3
  def optimize
4
4
  manipulate! do |img|
5
- Piet.optimize(current_path)
5
+ Piet.optimize(img.path)
6
6
  img
7
7
  end
8
8
  end
data/lib/piet/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Piet
2
- VERSION = "0.1.1"
2
+ VERSION = "0.1.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: piet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-30 00:00:00.000000000 Z
12
+ date: 2013-01-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec