aboutsummaryrefslogtreecommitdiffstats
path: root/src/psddescriptor.coffee
diff options
context:
space:
mode:
authormeltingice <meltingice8917@gmail.com>2012-07-24 21:11:07 -0400
committermeltingice <meltingice8917@gmail.com>2012-07-24 21:11:07 -0400
commit5534d471f250ff3afe40144a5af37c7a8cbabecc (patch)
tree753f2059d638b236a11b2b1aa0b6d3ff3f50831f /src/psddescriptor.coffee
parentUpdate documentation (diff)
downloadpsd.js-5534d471f250ff3afe40144a5af37c7a8cbabecc.tar.xz
psd.js-5534d471f250ff3afe40144a5af37c7a8cbabecc.zip
Added parsing of both legacy and current layer effects. Current layer effects needs a lot of work to make it more human readable though.
Diffstat (limited to 'src/psddescriptor.coffee')
-rw-r--r--src/psddescriptor.coffee12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/psddescriptor.coffee b/src/psddescriptor.coffee
index 2d0322c..3b6213b 100644
--- a/src/psddescriptor.coffee
+++ b/src/psddescriptor.coffee
@@ -29,11 +29,13 @@ class PSDDescriptor
id: @parseID()
parseKeyItem: ->
- id: @parseID()
- value: @parseItem()
+ id = @parseID()
+ value = @parseItem(id)
- parseItem: ->
- type = @file.readString(4)
+ id: id, value: value
+
+ parseItem: (id, type = null) ->
+ type = @file.readString(4) unless type
Log.debug "Found descriptor type: #{type}"
value = switch type
@@ -142,7 +144,7 @@ class PSDDescriptor
value
parseUnitDouble: ->
- unitID = @file.parseString(4)
+ unitID = @file.readString(4)
unit = switch unitID
when "#Ang" then "Angle"
when "#Rsl" then "Density"