psd 1.3.0 → 1.3.2

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: d04a7ff525ba486c5d37f11d89b6106c5ae9960a
4
- data.tar.gz: 8993d2ce5b328983e55ee77a1ba6297afc37ad0a
3
+ metadata.gz: 07d04a8de80525605f55cc1346b195d159448da4
4
+ data.tar.gz: 0eb80cec71da604ffa67e727ad90377b881dd028
5
5
  SHA512:
6
- metadata.gz: e5da04951ba02c95f1770574a70258736033ff3b9d8b74ede4873592c3ac102fe7972372df4e5ae8f5279d5044c7a475ac5f7de5e86611769d9db59234edf693
7
- data.tar.gz: c2e37f8843ff642688c8ea136e28821c51ba8f964368026968301a69046eee757b7b4e48480fe91ff43bd18542d95814046fef9c07cee604aa6f25ad3466393f
6
+ metadata.gz: 5dab1760c194b6abffe95ee77d061987dfb1d0cf8e7c59375d2f78726c912d36ef786fd5e240d7305d8edefe2f2650fea1546bdfc55b41ce2620d142383ed251
7
+ data.tar.gz: e04a6725116b6be409215c47fb1d208c7aaacdb4959d84cbc9390d43cd9f2f96378858ac31880be427a02ada478320523a7cec37923bdc7b914d15f7e9d47197
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # PSD.rb
2
2
 
3
- [![Travis CI](https://travis-ci.org/layervault/psd.rb.png)](https://travis-ci.org/layervault/psd.rb)
3
+ [![Travis CI](https://travis-ci.org/layervault/psd.rb.png?branch=master)](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
 
@@ -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
- if channels == 5
9
- a = @channel_data[i]
10
- c = @channel_data[i + @channel_length]
11
- m = @channel_data[i + @channel_length * 2]
12
- y = @channel_data[i + @channel_length * 3]
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
- alpha = @channel_data[i]
10
- grey = @channel_data[@channel_length + i]
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
@@ -21,13 +21,13 @@ class PSD::Node
21
21
 
22
22
  # Calculated height of this folder.
23
23
  def rows
24
- @right - @left
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
- @bottom - @top
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
@@ -1,3 +1,3 @@
1
1
  class PSD
2
- VERSION = "1.3.0"
2
+ VERSION = "1.3.2"
3
3
  end
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.0
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-09-28 00:00:00.000000000 Z
12
+ date: 2013-10-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake