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
b2a661b5
Commit
b2a661b5
authored
May 04, 2014
by
Ryan LeFevre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fill out node properties and recurse export
parent
6a23a9a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
7 deletions
+27
-7
parse.js
examples/parse.js
+1
-1
group.coffee
lib/psd/nodes/group.coffee
+8
-2
layer.coffee
lib/psd/nodes/layer.coffee
+9
-2
root.coffee
lib/psd/nodes/root.coffee
+9
-2
No files found.
examples/parse.js
View file @
b2a661b5
...
@@ -8,4 +8,4 @@ console.log(psd.header.export());
...
@@ -8,4 +8,4 @@ console.log(psd.header.export());
// console.log("Finished!");
// console.log("Finished!");
// });
// });
console
.
log
(
psd
.
tree
().
export
());
console
.
log
(
psd
.
tree
().
children
[
0
].
export
());
\ No newline at end of file
\ No newline at end of file
lib/psd/nodes/group.coffee
View file @
b2a661b5
_
=
require
'lodash'
Node
=
require
'../node.coffee'
Node
=
require
'../node.coffee'
module
.
exports
=
class
Group
extends
Node
module
.
exports
=
class
Group
extends
Node
type
:
'group'
type
:
'group'
passthruBlending
:
->
passthruBlending
:
->
@
get
(
'blendingMode'
)
is
'passthru'
@
get
(
'blendingMode'
)
is
'passthru'
isEmpty
:
->
isEmpty
:
->
return
false
unless
child
.
isEmpty
()
for
child
in
@
children
return
false
unless
child
.
isEmpty
()
for
child
in
@
children
\ No newline at end of file
export
:
->
_
.
merge
super
(),
type
:
'group'
children
:
@
children
.
map
((
c
)
->
c
.
export
())
\ No newline at end of file
lib/psd/nodes/layer.coffee
View file @
b2a661b5
_
=
require
'lodash'
Node
=
require
'../node.coffee'
Node
=
require
'../node.coffee'
module
.
exports
=
class
Layer
extends
Node
module
.
exports
=
class
Layer
extends
Node
type
:
'layer'
type
:
'layer'
isEmpty
:
->
@
width
is
0
or
@
height
is
0
isEmpty
:
->
@
width
is
0
or
@
height
is
0
\ No newline at end of file
export
:
->
_
.
merge
super
,
type
:
'layer'
mask
:
@
layer
.
mask
.
export
()
image
:
{}
\ No newline at end of file
lib/psd/nodes/root.coffee
View file @
b2a661b5
...
@@ -21,8 +21,8 @@ module.exports = class Root extends Node
...
@@ -21,8 +21,8 @@ module.exports = class Root extends Node
@
buildHeirarchy
()
@
buildHeirarchy
()
documentDimensions
:
->
[
documentDimensions
:
->
[
@
documentWidth
()
,
@
width
,
@
documentHeight
()
@
height
]
]
depth
:
->
0
depth
:
->
0
...
@@ -31,6 +31,13 @@ module.exports = class Root extends Node
...
@@ -31,6 +31,13 @@ module.exports = class Root extends Node
export
:
->
export
:
->
children
:
@
children
.
map
((
c
)
->
c
.
export
())
children
:
@
children
.
map
((
c
)
->
c
.
export
())
document
:
width
:
@
width
height
:
@
height
resources
:
layerComps
:
[]
guides
:
[]
slices
:
[]
buildHeirarchy
:
->
buildHeirarchy
:
->
...
...
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