Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psd-parse-web
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
劳工
psd-parse-web
Commits
183b25b2
Commit
183b25b2
authored
Nov 19, 2020
by
张九刚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改node版本
parent
005b9d53
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
5 deletions
+8
-5
zeroing.js
src/zeroing.js
+8
-5
No files found.
src/zeroing.js
View file @
183b25b2
...
@@ -32,10 +32,9 @@ const offsetAll = 176;
...
@@ -32,10 +32,9 @@ const offsetAll = 176;
async
function
execute
(
psdFile
,
options
)
{
async
function
execute
(
psdFile
,
options
)
{
console
.
log
(
"psdFile:"
,
psdFile
);
console
.
log
(
"psdFile:"
,
psdFile
);
const
{
imagesPath
}
=
options
;
const
{
projectPath
}
=
options
;
if
(
!
imagesPath
)
if
(
!
projectPath
)
{
{
console
.
log
(
"没有指定cache目录"
);
console
.
log
(
"没有指定cache目录"
);
}
}
...
@@ -237,7 +236,11 @@ async function execute(psdFile, options) {
...
@@ -237,7 +236,11 @@ async function execute(psdFile, options) {
let
buffer
;
let
buffer
;
try
{
try
{
let
img
=
node
.
origin
.
toPng
();
let
img
=
node
.
origin
.
toPng
();
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
let
cachePath
=
path
.
join
(
projectPath
,
'/assestcache/'
);
if
(
!
fs
.
existsSync
(
cachePath
))
{
fs
.
mkdirsSync
(
cachePath
);
}
const
imageFilePath
=
path
.
join
(
projectPath
,
'/assestcache/'
+
uuid
+
ext
);
buffer
=
await
savePng
(
img
,
imageFilePath
).
catch
(
e
=>
{
buffer
=
await
savePng
(
img
,
imageFilePath
).
catch
(
e
=>
{
});
});
dataUrl
=
buffer
.
toString
(
'base64'
);
dataUrl
=
buffer
.
toString
(
'base64'
);
...
...
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