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
539ca415
Commit
539ca415
authored
Nov 08, 2014
by
Ryan LeFevre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add PNG export functions to Node
parent
03c5ccc3
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5411 additions
and
277 deletions
+5411
-277
psd.js
dist/psd.js
+5406
-275
export_layers.js
examples/node/export_layers.js
+1
-1
node.coffee
lib/psd/node.coffee
+1
-1
build_preview.coffee
lib/psd/nodes/build_preview.coffee
+3
-0
No files found.
dist/psd.js
View file @
539ca415
This diff is collapsed.
Click to expand it.
examples/node/export_layers.js
View file @
539ca415
...
...
@@ -6,7 +6,7 @@ var start = new Date();
PSD
.
open
(
file
).
then
(
function
(
psd
)
{
psd
.
tree
().
descendants
().
forEach
(
function
(
node
)
{
if
(
node
.
isGroup
())
return
true
;
node
.
layer
.
image
.
saveAsPng
(
"./output/"
+
node
.
name
+
".png"
).
catch
(
function
(
err
)
{
node
.
saveAsPng
(
"./output/"
+
node
.
name
+
".png"
).
catch
(
function
(
err
)
{
console
.
log
(
err
.
stack
);
});
});
...
...
lib/psd/node.coffee
View file @
539ca415
...
...
@@ -4,7 +4,7 @@ _ = require 'lodash'
module
.
exports
=
class
Node
extends
Module
@
includes
require
(
'./nodes/ancestry.coffee'
)
@
includes
require
(
'./nodes/search.coffee'
)
#
@includes require('./nodes/build_preview.coffee')
@
includes
require
(
'./nodes/build_preview.coffee'
)
@
PROPERTIES
:
[
'name'
,
'left'
,
'right'
,
'top'
,
'bottom'
,
'height'
,
'width'
]
...
...
lib/psd/nodes/build_preview.coffee
0 → 100644
View file @
539ca415
module
.
exports
=
toPng
:
->
@
layer
.
image
.
toPng
()
saveAsPng
:
(
output
)
->
@
layer
.
image
.
saveAsPng
(
output
)
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