Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
psd-parse
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
Commits
44222d47
Commit
44222d47
authored
Dec 05, 2019
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
解决字体大小找不到的问题
parent
3a07ad83
Changes
11
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
67 additions
and
52 deletions
+67
-52
index.es.js
dist/index.es.js
+12
-9
index.es.js.map
dist/index.es.js.map
+1
-1
index.js
dist/index.js
+12
-9
index.js.map
dist/index.js.map
+1
-1
index.umd.js
dist/index.umd.js
+12
-9
index.umd.js.map
dist/index.umd.js.map
+1
-1
package.json
package.json
+1
-1
generator.cjs.js
samples/zeroing-demo/generator.cjs.js
+13
-10
generator.cjs.js.map
samples/zeroing-demo/generator.cjs.js.map
+1
-1
generator.js
samples/zeroing-demo/generator.js
+1
-1
zeroing.js
src/zeroing.js
+12
-9
No files found.
dist/index.es.js
View file @
44222d47
...
@@ -259,8 +259,10 @@ async function execute$1(psdFile, options) {
...
@@ -259,8 +259,10 @@ async function execute$1(psdFile, options) {
//const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
//const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties
.
text
=
fontInfo
.
textValue
;
properties
.
text
=
fontInfo
.
textValue
;
properties
.
size
=
fontInfo
.
sizes
()[
0
];
const
sizes
=
fontInfo
.
sizes
();
let
[
r
,
g
,
b
,
a
]
=
fontInfo
.
colors
()[
0
];
const
colors
=
fontInfo
.
colors
();
properties
.
size
=
sizes
?
sizes
[
0
]
||
20
:
20
;
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
/*properties.textflow = {
/*properties.textflow = {
fonts, styles, RunLengthArray,
fonts, styles, RunLengthArray,
...
@@ -272,15 +274,15 @@ async function execute$1(psdFile, options) {
...
@@ -272,15 +274,15 @@ async function execute$1(psdFile, options) {
let
color
=
Color
({
r
,
g
,
b
});
let
color
=
Color
({
r
,
g
,
b
});
let
paths
=
layer
.
vectorMask
().
paths
;
let
paths
=
layer
.
vectorMask
().
paths
;
if
(
paths
[
2
].
numPoints
===
4
)
{
if
(
paths
[
2
].
numPoints
===
4
)
{
let
isRect
=
true
;
let
isRect
=
true
;
for
(
let
i
=
3
;
i
<
paths
.
length
;
i
++
)
{
for
(
let
i
=
3
;
i
<
paths
.
length
;
i
++
)
{
if
(
paths
[
i
].
recordType
!==
2
)
{
if
(
paths
[
i
].
recordType
!==
2
)
{
isRect
=
false
;
isRect
=
false
;
break
;
break
;
}
}
}
}
if
(
isRect
)
{
if
(
isRect
)
{
viewNode
.
type
=
'rect'
;
viewNode
.
type
=
'rect'
;
properties
.
fillColor
=
'#'
+
color
.
rgbNumber
().
toString
(
16
);
properties
.
fillColor
=
'#'
+
color
.
rgbNumber
().
toString
(
16
);
dealLater
=
false
;
dealLater
=
false
;
...
@@ -288,7 +290,7 @@ async function execute$1(psdFile, options) {
...
@@ -288,7 +290,7 @@ async function execute$1(psdFile, options) {
}
}
}
}
if
(
dealLater
)
{
if
(
dealLater
)
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
viewNode
.
type
=
'node'
;
viewNode
.
type
=
'node'
;
}
else
{
}
else
{
...
@@ -300,10 +302,11 @@ async function execute$1(psdFile, options) {
...
@@ -300,10 +302,11 @@ async function execute$1(psdFile, options) {
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
await
fs
.
ensureDir
(
path
.
dirname
(
imageFilePath
));
await
fs
.
ensureDir
(
path
.
dirname
(
imageFilePath
));
let
png
=
node
.
origin
.
toPng
();
let
png
=
node
.
origin
.
toPng
();
let
buffer
=
await
savePng
(
png
,
imageFilePath
).
catch
(
e
=>
{});
let
buffer
=
await
savePng
(
png
,
imageFilePath
).
catch
(
e
=>
{
});
//await node.origin.saveAsPng(imageFilePath);
//await node.origin.saveAsPng(imageFilePath);
if
(
buffer
)
{
if
(
buffer
)
{
properties
.
source
=
'asset://'
+
uuid
;
properties
.
source
=
'asset://'
+
uuid
;
const
hashFileName
=
hash
(
buffer
);
const
hashFileName
=
hash
(
buffer
);
...
...
dist/index.es.js.map
View file @
44222d47
This diff is collapsed.
Click to expand it.
dist/index.js
View file @
44222d47
...
@@ -265,8 +265,10 @@ async function execute$1(psdFile, options) {
...
@@ -265,8 +265,10 @@ async function execute$1(psdFile, options) {
//const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
//const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties
.
text
=
fontInfo
.
textValue
;
properties
.
text
=
fontInfo
.
textValue
;
properties
.
size
=
fontInfo
.
sizes
()[
0
];
const
sizes
=
fontInfo
.
sizes
();
let
[
r
,
g
,
b
,
a
]
=
fontInfo
.
colors
()[
0
];
const
colors
=
fontInfo
.
colors
();
properties
.
size
=
sizes
?
sizes
[
0
]
||
20
:
20
;
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
/*properties.textflow = {
/*properties.textflow = {
fonts, styles, RunLengthArray,
fonts, styles, RunLengthArray,
...
@@ -278,15 +280,15 @@ async function execute$1(psdFile, options) {
...
@@ -278,15 +280,15 @@ async function execute$1(psdFile, options) {
let
color
=
Color
({
r
,
g
,
b
});
let
color
=
Color
({
r
,
g
,
b
});
let
paths
=
layer
.
vectorMask
().
paths
;
let
paths
=
layer
.
vectorMask
().
paths
;
if
(
paths
[
2
].
numPoints
===
4
)
{
if
(
paths
[
2
].
numPoints
===
4
)
{
let
isRect
=
true
;
let
isRect
=
true
;
for
(
let
i
=
3
;
i
<
paths
.
length
;
i
++
)
{
for
(
let
i
=
3
;
i
<
paths
.
length
;
i
++
)
{
if
(
paths
[
i
].
recordType
!==
2
)
{
if
(
paths
[
i
].
recordType
!==
2
)
{
isRect
=
false
;
isRect
=
false
;
break
;
break
;
}
}
}
}
if
(
isRect
)
{
if
(
isRect
)
{
viewNode
.
type
=
'rect'
;
viewNode
.
type
=
'rect'
;
properties
.
fillColor
=
'#'
+
color
.
rgbNumber
().
toString
(
16
);
properties
.
fillColor
=
'#'
+
color
.
rgbNumber
().
toString
(
16
);
dealLater
=
false
;
dealLater
=
false
;
...
@@ -294,7 +296,7 @@ async function execute$1(psdFile, options) {
...
@@ -294,7 +296,7 @@ async function execute$1(psdFile, options) {
}
}
}
}
if
(
dealLater
)
{
if
(
dealLater
)
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
viewNode
.
type
=
'node'
;
viewNode
.
type
=
'node'
;
}
else
{
}
else
{
...
@@ -306,10 +308,11 @@ async function execute$1(psdFile, options) {
...
@@ -306,10 +308,11 @@ async function execute$1(psdFile, options) {
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
await
fs
.
ensureDir
(
path
.
dirname
(
imageFilePath
));
await
fs
.
ensureDir
(
path
.
dirname
(
imageFilePath
));
let
png
=
node
.
origin
.
toPng
();
let
png
=
node
.
origin
.
toPng
();
let
buffer
=
await
savePng
(
png
,
imageFilePath
).
catch
(
e
=>
{});
let
buffer
=
await
savePng
(
png
,
imageFilePath
).
catch
(
e
=>
{
});
//await node.origin.saveAsPng(imageFilePath);
//await node.origin.saveAsPng(imageFilePath);
if
(
buffer
)
{
if
(
buffer
)
{
properties
.
source
=
'asset://'
+
uuid
;
properties
.
source
=
'asset://'
+
uuid
;
const
hashFileName
=
hash
(
buffer
);
const
hashFileName
=
hash
(
buffer
);
...
...
dist/index.js.map
View file @
44222d47
This diff is collapsed.
Click to expand it.
dist/index.umd.js
View file @
44222d47
...
@@ -265,8 +265,10 @@
...
@@ -265,8 +265,10 @@
//const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
//const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties
.
text
=
fontInfo
.
textValue
;
properties
.
text
=
fontInfo
.
textValue
;
properties
.
size
=
fontInfo
.
sizes
()[
0
];
const
sizes
=
fontInfo
.
sizes
();
let
[
r
,
g
,
b
,
a
]
=
fontInfo
.
colors
()[
0
];
const
colors
=
fontInfo
.
colors
();
properties
.
size
=
sizes
?
sizes
[
0
]
||
20
:
20
;
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
/*properties.textflow = {
/*properties.textflow = {
fonts, styles, RunLengthArray,
fonts, styles, RunLengthArray,
...
@@ -278,15 +280,15 @@
...
@@ -278,15 +280,15 @@
let
color
=
Color
({
r
,
g
,
b
});
let
color
=
Color
({
r
,
g
,
b
});
let
paths
=
layer
.
vectorMask
().
paths
;
let
paths
=
layer
.
vectorMask
().
paths
;
if
(
paths
[
2
].
numPoints
===
4
)
{
if
(
paths
[
2
].
numPoints
===
4
)
{
let
isRect
=
true
;
let
isRect
=
true
;
for
(
let
i
=
3
;
i
<
paths
.
length
;
i
++
)
{
for
(
let
i
=
3
;
i
<
paths
.
length
;
i
++
)
{
if
(
paths
[
i
].
recordType
!==
2
)
{
if
(
paths
[
i
].
recordType
!==
2
)
{
isRect
=
false
;
isRect
=
false
;
break
;
break
;
}
}
}
}
if
(
isRect
)
{
if
(
isRect
)
{
viewNode
.
type
=
'rect'
;
viewNode
.
type
=
'rect'
;
properties
.
fillColor
=
'#'
+
color
.
rgbNumber
().
toString
(
16
);
properties
.
fillColor
=
'#'
+
color
.
rgbNumber
().
toString
(
16
);
dealLater
=
false
;
dealLater
=
false
;
...
@@ -294,7 +296,7 @@
...
@@ -294,7 +296,7 @@
}
}
}
}
if
(
dealLater
)
{
if
(
dealLater
)
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
viewNode
.
type
=
'node'
;
viewNode
.
type
=
'node'
;
}
else
{
}
else
{
...
@@ -306,10 +308,11 @@
...
@@ -306,10 +308,11 @@
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
await
fs
.
ensureDir
(
path
.
dirname
(
imageFilePath
));
await
fs
.
ensureDir
(
path
.
dirname
(
imageFilePath
));
let
png
=
node
.
origin
.
toPng
();
let
png
=
node
.
origin
.
toPng
();
let
buffer
=
await
savePng
(
png
,
imageFilePath
).
catch
(
e
=>
{});
let
buffer
=
await
savePng
(
png
,
imageFilePath
).
catch
(
e
=>
{
});
//await node.origin.saveAsPng(imageFilePath);
//await node.origin.saveAsPng(imageFilePath);
if
(
buffer
)
{
if
(
buffer
)
{
properties
.
source
=
'asset://'
+
uuid
;
properties
.
source
=
'asset://'
+
uuid
;
const
hashFileName
=
hash
(
buffer
);
const
hashFileName
=
hash
(
buffer
);
...
...
dist/index.umd.js.map
View file @
44222d47
This diff is collapsed.
Click to expand it.
package.json
View file @
44222d47
{
{
"name"
:
"psd-parse"
,
"name"
:
"psd-parse"
,
"version"
:
"1.0.
3
"
,
"version"
:
"1.0.
4
"
,
"main"
:
"dist/index.js"
,
"main"
:
"dist/index.js"
,
"license"
:
"
MIT
"
,
"license"
:
"
MIT
"
,
"dependencies"
:
{
"dependencies"
:
{
...
...
samples/zeroing-demo/generator.cjs.js
View file @
44222d47
...
@@ -109,8 +109,10 @@ async function execute(psdFile, options) {
...
@@ -109,8 +109,10 @@ async function execute(psdFile, options) {
//const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
//const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties
.
text
=
fontInfo
.
textValue
;
properties
.
text
=
fontInfo
.
textValue
;
properties
.
size
=
fontInfo
.
sizes
()[
0
];
const
sizes
=
fontInfo
.
sizes
();
let
[
r
,
g
,
b
,
a
]
=
fontInfo
.
colors
()[
0
];
const
colors
=
fontInfo
.
colors
();
properties
.
size
=
sizes
?
sizes
[
0
]
||
20
:
20
;
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
/*properties.textflow = {
/*properties.textflow = {
fonts, styles, RunLengthArray,
fonts, styles, RunLengthArray,
...
@@ -122,15 +124,15 @@ async function execute(psdFile, options) {
...
@@ -122,15 +124,15 @@ async function execute(psdFile, options) {
let
color
=
Color
({
r
,
g
,
b
});
let
color
=
Color
({
r
,
g
,
b
});
let
paths
=
layer
.
vectorMask
().
paths
;
let
paths
=
layer
.
vectorMask
().
paths
;
if
(
paths
[
2
].
numPoints
===
4
)
{
if
(
paths
[
2
].
numPoints
===
4
)
{
let
isRect
=
true
;
let
isRect
=
true
;
for
(
let
i
=
3
;
i
<
paths
.
length
;
i
++
)
{
for
(
let
i
=
3
;
i
<
paths
.
length
;
i
++
)
{
if
(
paths
[
i
].
recordType
!==
2
)
{
if
(
paths
[
i
].
recordType
!==
2
)
{
isRect
=
false
;
isRect
=
false
;
break
;
break
;
}
}
}
}
if
(
isRect
)
{
if
(
isRect
)
{
viewNode
.
type
=
'rect'
;
viewNode
.
type
=
'rect'
;
properties
.
fillColor
=
'#'
+
color
.
rgbNumber
().
toString
(
16
);
properties
.
fillColor
=
'#'
+
color
.
rgbNumber
().
toString
(
16
);
dealLater
=
false
;
dealLater
=
false
;
...
@@ -138,7 +140,7 @@ async function execute(psdFile, options) {
...
@@ -138,7 +140,7 @@ async function execute(psdFile, options) {
}
}
}
}
if
(
dealLater
)
{
if
(
dealLater
)
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
viewNode
.
type
=
'node'
;
viewNode
.
type
=
'node'
;
}
else
{
}
else
{
...
@@ -150,10 +152,11 @@ async function execute(psdFile, options) {
...
@@ -150,10 +152,11 @@ async function execute(psdFile, options) {
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
await
fs
.
ensureDir
(
path
.
dirname
(
imageFilePath
));
await
fs
.
ensureDir
(
path
.
dirname
(
imageFilePath
));
let
png
=
node
.
origin
.
toPng
();
let
png
=
node
.
origin
.
toPng
();
let
buffer
=
await
savePng
(
png
,
imageFilePath
).
catch
(
e
=>
{});
let
buffer
=
await
savePng
(
png
,
imageFilePath
).
catch
(
e
=>
{
});
//await node.origin.saveAsPng(imageFilePath);
//await node.origin.saveAsPng(imageFilePath);
if
(
buffer
)
{
if
(
buffer
)
{
properties
.
source
=
'asset://'
+
uuid
;
properties
.
source
=
'asset://'
+
uuid
;
const
hashFileName
=
hash
(
buffer
);
const
hashFileName
=
hash
(
buffer
);
...
@@ -208,7 +211,7 @@ function savePng(png, output) {
...
@@ -208,7 +211,7 @@ function savePng(png, output) {
(
async
function
generate
()
{
(
async
function
generate
()
{
const
imagesPath
=
'zeroing-demo/images_'
+
Date
.
now
();
const
imagesPath
=
'zeroing-demo/images_'
+
Date
.
now
();
const
{
view
,
assets
}
=
await
execute
(
'psd/
shapes
.psd'
,
{
const
{
view
,
assets
}
=
await
execute
(
'psd/
test2
.psd'
,
{
imagesPath
,
imagesPath
,
});
});
...
...
samples/zeroing-demo/generator.cjs.js.map
View file @
44222d47
This diff is collapsed.
Click to expand it.
samples/zeroing-demo/generator.js
View file @
44222d47
...
@@ -7,7 +7,7 @@ import {toZeroing} from "../../src/index";
...
@@ -7,7 +7,7 @@ import {toZeroing} from "../../src/index";
(
async
function
generate
()
{
(
async
function
generate
()
{
const
imagesPath
=
'zeroing-demo/images_'
+
Date
.
now
();
const
imagesPath
=
'zeroing-demo/images_'
+
Date
.
now
();
const
{
view
,
assets
}
=
await
toZeroing
(
'psd/
shapes
.psd'
,
{
const
{
view
,
assets
}
=
await
toZeroing
(
'psd/
test2
.psd'
,
{
imagesPath
,
imagesPath
,
});
});
...
...
src/zeroing.js
View file @
44222d47
...
@@ -52,8 +52,10 @@ export async function execute(psdFile, options) {
...
@@ -52,8 +52,10 @@ export async function execute(psdFile, options) {
//const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
//const {RunLengthArray} = fontInfo.engineData.EngineDict.StyleRun;
properties
.
text
=
fontInfo
.
textValue
;
properties
.
text
=
fontInfo
.
textValue
;
properties
.
size
=
fontInfo
.
sizes
()[
0
];
const
sizes
=
fontInfo
.
sizes
();
let
[
r
,
g
,
b
,
a
]
=
fontInfo
.
colors
()[
0
];
const
colors
=
fontInfo
.
colors
();
properties
.
size
=
sizes
?
sizes
[
0
]
||
20
:
20
;
let
[
r
,
g
,
b
,
a
]
=
colors
[
0
];
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
properties
.
fillColor
=
`rgba(
${
r
}
,
${
g
}
,
${
b
}
,
${
a
/
255
}
)`
;
/*properties.textflow = {
/*properties.textflow = {
fonts, styles, RunLengthArray,
fonts, styles, RunLengthArray,
...
@@ -65,15 +67,15 @@ export async function execute(psdFile, options) {
...
@@ -65,15 +67,15 @@ export async function execute(psdFile, options) {
let
color
=
Color
({
r
,
g
,
b
});
let
color
=
Color
({
r
,
g
,
b
});
let
paths
=
layer
.
vectorMask
().
paths
;
let
paths
=
layer
.
vectorMask
().
paths
;
if
(
paths
[
2
].
numPoints
===
4
)
{
if
(
paths
[
2
].
numPoints
===
4
)
{
let
isRect
=
true
;
let
isRect
=
true
;
for
(
let
i
=
3
;
i
<
paths
.
length
;
i
++
)
{
for
(
let
i
=
3
;
i
<
paths
.
length
;
i
++
)
{
if
(
paths
[
i
].
recordType
!==
2
)
{
if
(
paths
[
i
].
recordType
!==
2
)
{
isRect
=
false
;
isRect
=
false
;
break
;
break
;
}
}
}
}
if
(
isRect
)
{
if
(
isRect
)
{
viewNode
.
type
=
'rect'
;
viewNode
.
type
=
'rect'
;
properties
.
fillColor
=
'#'
+
color
.
rgbNumber
().
toString
(
16
);
properties
.
fillColor
=
'#'
+
color
.
rgbNumber
().
toString
(
16
);
dealLater
=
false
;
dealLater
=
false
;
...
@@ -81,7 +83,7 @@ export async function execute(psdFile, options) {
...
@@ -81,7 +83,7 @@ export async function execute(psdFile, options) {
}
}
}
}
if
(
dealLater
)
{
if
(
dealLater
)
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
if
(
node
.
hasOwnProperty
(
'children'
))
{
viewNode
.
type
=
'node'
;
viewNode
.
type
=
'node'
;
}
else
{
}
else
{
...
@@ -93,10 +95,11 @@ export async function execute(psdFile, options) {
...
@@ -93,10 +95,11 @@ export async function execute(psdFile, options) {
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
const
imageFilePath
=
path
.
join
(
imagesPath
,
uuid
+
ext
);
await
fs
.
ensureDir
(
path
.
dirname
(
imageFilePath
));
await
fs
.
ensureDir
(
path
.
dirname
(
imageFilePath
));
let
png
=
node
.
origin
.
toPng
();
let
png
=
node
.
origin
.
toPng
();
let
buffer
=
await
savePng
(
png
,
imageFilePath
).
catch
(
e
=>
{});
let
buffer
=
await
savePng
(
png
,
imageFilePath
).
catch
(
e
=>
{
});
//await node.origin.saveAsPng(imageFilePath);
//await node.origin.saveAsPng(imageFilePath);
if
(
buffer
)
{
if
(
buffer
)
{
properties
.
source
=
'asset://'
+
uuid
;
properties
.
source
=
'asset://'
+
uuid
;
const
hashFileName
=
hash
(
buffer
);
const
hashFileName
=
hash
(
buffer
);
...
...
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