psd 1.3.0 → 1.3.2
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/psd/image_modes/cmyk.rb +5 -13
- data/lib/psd/image_modes/greyscale.rb +2 -2
- data/lib/psd/node_group.rb +3 -3
- data/lib/psd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07d04a8de80525605f55cc1346b195d159448da4
|
4
|
+
data.tar.gz: 0eb80cec71da604ffa67e727ad90377b881dd028
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5dab1760c194b6abffe95ee77d061987dfb1d0cf8e7c59375d2f78726c912d36ef786fd5e240d7305d8edefe2f2650fea1546bdfc55b41ce2620d142383ed251
|
7
|
+
data.tar.gz: e04a6725116b6be409215c47fb1d208c7aaacdb4959d84cbc9390d43cd9f2f96378858ac31880be427a02ada478320523a7cec37923bdc7b914d15f7e9d47197
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# PSD.rb
|
2
2
|
|
3
|
-
[](https://travis-ci.org/layervault/psd.rb)
|
3
|
+
[](https://travis-ci.org/layervault/psd.rb)
|
4
4
|
|
5
5
|
A general purpose Photoshop file parser written in Ruby. It allows you to work with a Photoshop document in a manageable tree structure and find out important data such as:
|
6
6
|
|
data/lib/psd/image_modes/cmyk.rb
CHANGED
@@ -5,19 +5,11 @@ class PSD
|
|
5
5
|
|
6
6
|
def combine_cmyk_channel
|
7
7
|
(0...@num_pixels).step(pixel_step) do |i|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
k = @channel_data[i + @channel_length * 4]
|
14
|
-
else
|
15
|
-
a = 255
|
16
|
-
c = @channel_data[i]
|
17
|
-
m = @channel_data[i + @channel_length]
|
18
|
-
y = @channel_data[i + @channel_length * 2]
|
19
|
-
k = @channel_data[i + @channel_length * 3]
|
20
|
-
end
|
8
|
+
c = @channel_data[i]
|
9
|
+
m = @channel_data[i + @channel_length]
|
10
|
+
y = @channel_data[i + @channel_length * 2]
|
11
|
+
k = @channel_data[i + @channel_length * 3]
|
12
|
+
a = (channels == 5 ? @channel_data[i + @channel_length * 4] : 255)
|
21
13
|
|
22
14
|
rgb = PSD::Color.cmyk_to_rgb(255 - c, 255 - m, 255 - y, 255 - k)
|
23
15
|
|
@@ -6,8 +6,8 @@ class PSD
|
|
6
6
|
def combine_greyscale_channel
|
7
7
|
if channels == 2
|
8
8
|
(0...@num_pixels).step(pixel_step) do |i|
|
9
|
-
|
10
|
-
|
9
|
+
grey = @channel_data[i]
|
10
|
+
alpha = @channel_data[@channel_length + i]
|
11
11
|
|
12
12
|
@pixel_data.push ChunkyPNG::Color.greyscale_alpha(grey, alpha)
|
13
13
|
end
|
data/lib/psd/node_group.rb
CHANGED
@@ -21,13 +21,13 @@ class PSD::Node
|
|
21
21
|
|
22
22
|
# Calculated height of this folder.
|
23
23
|
def rows
|
24
|
-
@
|
24
|
+
@bottom - @top
|
25
25
|
end
|
26
26
|
alias :height :rows
|
27
27
|
|
28
28
|
# Calculated width of this folder.
|
29
29
|
def cols
|
30
|
-
@
|
30
|
+
@right - @left
|
31
31
|
end
|
32
32
|
alias :width :cols
|
33
33
|
|
@@ -70,4 +70,4 @@ class PSD::Node
|
|
70
70
|
@right = @children.map(&:right).max || 0
|
71
71
|
end
|
72
72
|
end
|
73
|
-
end
|
73
|
+
end
|
data/lib/psd/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: psd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan LeFevre
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-10-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|