acbaker 0.0.8 → 0.0.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/acbaker/processors/base.rb +1 -2
- data/lib/acbaker/processors/center.rb +4 -1
- data/lib/acbaker/processors/constraint.rb +0 -1
- data/lib/acbaker/processors/contain.rb +4 -1
- data/lib/acbaker/processors/cover.rb +4 -1
- data/lib/acbaker/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9ae87d8d0116132643efd054dd902f11f7415dd
|
4
|
+
data.tar.gz: 4caa61508232fa88cfefc656a6ff7df2030d14f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 320faf834aa04eebed124a329f5e6081cf194735ea7e9653c8e8081e4b824cb0c3e51455e6900011430a2eea1f687e5e5102ae0f23b3282d033a28a7fe6bf2cd
|
7
|
+
data.tar.gz: 0f67714166dbdd5642d293f41b32f32cd6a1f61442ac231fda37625b05e9e4a8b79ef1d7dd30b494081e79823d80783b82c67fe5265221a0fe942b5cf42458d1
|
data/README.md
CHANGED
@@ -2,11 +2,10 @@ module Acbaker
|
|
2
2
|
module Processors
|
3
3
|
class Base
|
4
4
|
attr_accessor :asset_pack, :options
|
5
|
-
@@defaults = {}
|
6
5
|
|
7
6
|
def initialize(asset_pack, options={})
|
8
7
|
@asset_pack = asset_pack
|
9
|
-
@options = options ?
|
8
|
+
@options = options ? defaults.merge(options) : defaults
|
10
9
|
end
|
11
10
|
|
12
11
|
def run(image, image_spec, width=nil, height=nil)
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module Acbaker
|
2
2
|
module Processors
|
3
3
|
class Center < Base
|
4
|
-
|
4
|
+
|
5
|
+
def defaults
|
6
|
+
{"max-width" => "50%", "background-color" => "#FFFFFF", "gravity" => "Center"}
|
7
|
+
end
|
5
8
|
|
6
9
|
def run(image, image_spec, width=nil, height=nil)
|
7
10
|
transform_width = width.to_f
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module Acbaker
|
2
2
|
module Processors
|
3
3
|
class Contain < Base
|
4
|
-
|
4
|
+
|
5
|
+
def defaults
|
6
|
+
{"background-color" => "#FFFFFF", "gravity" => "Center"}
|
7
|
+
end
|
5
8
|
|
6
9
|
def run(image, image_spec, width=nil, height=nil)
|
7
10
|
# resize image
|
@@ -1,7 +1,10 @@
|
|
1
1
|
module Acbaker
|
2
2
|
module Processors
|
3
3
|
class Cover < Base
|
4
|
-
|
4
|
+
|
5
|
+
def defaults
|
6
|
+
{"background-color" => "#FFFFFF", "gravity" => "Center"}
|
7
|
+
end
|
5
8
|
|
6
9
|
def run(image, image_spec, width=nil, height=nil)
|
7
10
|
# resize image
|
data/lib/acbaker/version.rb
CHANGED