acbaker 0.0.6 → 0.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/acbaker/asset_pack.rb +11 -9
- 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: d7b02ac721b50e1e19bbf92a6d1fcc16ce4b2eee
|
4
|
+
data.tar.gz: 931376cc55d92bad8d5963f0f93809ab8b34c5b2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 998a2683ab28aa176733374da9e9b6867940e3dbbf552ddf7e39c536e173a2bc448e8eba6f4f3ceb93e338e00e39b3be7cf598ee3e57e6e34e3e03012b9e4553
|
7
|
+
data.tar.gz: c2c111dc161dcbf63d01f7d928af2fc8705e14a5ad1a74c62bc328499d2e7b851ff4e5601ebc47c2d87b3298ff3368bd58a479af1d9d64dc67d369281a55faad
|
data/README.md
CHANGED
data/lib/acbaker/asset_pack.rb
CHANGED
@@ -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
|
-
|
44
|
-
image_spec['size'] = "#{
|
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
|
-
|
53
|
-
|
54
|
-
|
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
|
-
#
|
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
|
data/lib/acbaker/version.rb
CHANGED