acbaker 0.0.6 → 0.0.7

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: 7d47f4083dd69b97d8e22b739639fd13d85a833f
4
- data.tar.gz: 40cc181909e9ebcd6fbdf24bff73d3b2e5e4cfae
3
+ metadata.gz: d7b02ac721b50e1e19bbf92a6d1fcc16ce4b2eee
4
+ data.tar.gz: 931376cc55d92bad8d5963f0f93809ab8b34c5b2
5
5
  SHA512:
6
- metadata.gz: 9c7e66e084a2085e49e00fbfffe567f7149bf7130a232b7129f5c234e7ab4530fb124e0047024ed3f8b80294ee40b240e0e231f36b5af27e538d6604fa538734
7
- data.tar.gz: 9f2edbc654a1effbe76f73b9e80e6b04c710a4303440d5a88a9e688d23ade03028ae4bfaa01f36f94008c9b0cbec58db92e950fda793dbeef88a140ae0c68905
6
+ metadata.gz: 998a2683ab28aa176733374da9e9b6867940e3dbbf552ddf7e39c536e173a2bc448e8eba6f4f3ceb93e338e00e39b3be7cf598ee3e57e6e34e3e03012b9e4553
7
+ data.tar.gz: c2c111dc161dcbf63d01f7d928af2fc8705e14a5ad1a74c62bc328499d2e7b851ff4e5601ebc47c2d87b3298ff3368bd58a479af1d9d64dc67d369281a55faad
data/README.md CHANGED
@@ -20,7 +20,7 @@ USAGE
20
20
  CHANGELOG
21
21
  ---------
22
22
 
23
- * **0.0.6**
23
+ * **0.0.7**
24
24
  * Implemented processors (advanced image manipulations)
25
25
  * Added "center" strategy (align image in center with relative or absolute width constraints)
26
26
 
@@ -38,21 +38,24 @@ module Acbaker
38
38
 
39
39
  # Loop through images
40
40
  @json_data['images'].each_with_index.map do |image_spec, index|
41
-
41
+
42
42
  image_size_present = image_spec['size']
43
- image_magick = Magick::Image::read(source_image_file)[0]
44
- image_spec['size'] = "#{image_magick.columns.to_s}x#{image_magick.rows.to_s}" unless image_size_present
43
+ image = Magick::ImageList.new(source_image_file)
44
+ image_spec['size'] = "#{image.columns.to_s}x#{image.rows.to_s}" unless image_size_present
45
45
 
46
46
  # Get size
47
- scale = image_spec['scale'].gsub('x', '').to_i
47
+ scale = image_spec['scale'].gsub('x', '').to_i
48
48
  if image_size_present
49
49
  (width_str, height_str) = image_spec['size'].split('x')
50
50
  width = width_str.to_i * scale
51
51
  height = height_str.to_i * scale
52
- size_max = [width, height].max
53
- base_width = width / scale
54
- base_height = height / scale
52
+ else
53
+ width = image.columns
54
+ height = image.rows
55
55
  end
56
+ size_max = [width, height].max
57
+ base_width = width / scale
58
+ base_height = height / scale
56
59
 
57
60
  # Get version
58
61
  if image_spec['minimum-system-version'].nil?
@@ -95,8 +98,7 @@ module Acbaker
95
98
  filename = "#{filename_array.join('-')}.png"
96
99
  end
97
100
 
98
- # Generate image
99
- image = Magick::ImageList.new(source_image_file)
101
+ # process image
100
102
  @processors.each do |processor|
101
103
  image = processor.run(image, image_spec, width, height)
102
104
  end
@@ -1,3 +1,3 @@
1
1
  module Acbaker
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: acbaker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Strebitzer