Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psd.js
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
regiostart
psd.js
Commits
bb611c88
Commit
bb611c88
authored
Jun 13, 2016
by
Kelly Nichols
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added parsing of artboard layer data
parent
297c9935
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
3 deletions
+20
-3
info.coffee
lib/psd/layer/info.coffee
+4
-3
artboard.coffee
lib/psd/layer_info/artboard.coffee
+16
-0
No files found.
lib/psd/layer/info.coffee
View file @
bb611c88
...
@@ -3,11 +3,11 @@ Util = require '../util.coffee'
...
@@ -3,11 +3,11 @@ Util = require '../util.coffee'
# This is an incredibly important object because the majority of the layer information
# This is an incredibly important object because the majority of the layer information
# is contained in layer info blocks. The keys of this object define how the layer info
# is contained in layer info blocks. The keys of this object define how the layer info
# can be accessed. Each layer info block contains different data, so accessing the data
# can be accessed. Each layer info block contains different data, so accessing the data
# within each differs from type to type.
# within each differs from type to type.
#
#
# Here's an example of how to access some of this data:
# Here's an example of how to access some of this data:
#
#
# ``` coffeescript
# ``` coffeescript
# node = psd.tree().childrenAtPath('path/to/layer')[0]
# node = psd.tree().childrenAtPath('path/to/layer')[0]
# node.get('locked').allLocked
# node.get('locked').allLocked
...
@@ -15,6 +15,7 @@ Util = require '../util.coffee'
...
@@ -15,6 +15,7 @@ Util = require '../util.coffee'
# node.get('typeTool').export()
# node.get('typeTool').export()
# ```
# ```
LAYER_INFO
=
{
LAYER_INFO
=
{
artboard
:
require
(
'../layer_info/artboard.coffee'
)
blendClippingElements
:
require
(
'../layer_info/blend_clipping_elements.coffee'
)
blendClippingElements
:
require
(
'../layer_info/blend_clipping_elements.coffee'
)
blendInteriorElements
:
require
(
'../layer_info/blend_interior_elements.coffee'
)
blendInteriorElements
:
require
(
'../layer_info/blend_interior_elements.coffee'
)
fillOpacity
:
require
(
'../layer_info/fill_opacity.coffee'
)
fillOpacity
:
require
(
'../layer_info/fill_opacity.coffee'
)
...
...
lib/psd/layer_info/artboard.coffee
0 → 100644
View file @
bb611c88
LayerInfo
=
require
'../layer_info.coffee'
Descriptor
=
require
'../descriptor.coffee'
module
.
exports
=
class
Artboard
extends
LayerInfo
@
shouldParse
:
(
key
)
->
key
is
'artb'
parse
:
->
@
file
.
seek
4
,
true
@
data
=
new
Descriptor
(
@
file
).
parse
()
export
:
->
coords
:
left
:
@
data
.
artboardRect
[
'Left'
]
top
:
@
data
.
artboardRect
[
'Top '
]
right
:
@
data
.
artboardRect
[
'Rght'
]
bottom
:
@
data
.
artboardRect
[
'Btom'
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment