Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
duiba-tiny-image-node
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
劳工
duiba-tiny-image-node
Commits
e9f9c414
Commit
e9f9c414
authored
Mar 02, 2022
by
rockyl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
init
parent
a68139ce
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
3 additions
and
3 deletions
+3
-3
api.js
dist/api.js
+1
-1
api.js.map
dist/api.js.map
+1
-1
api.ts
src/api.ts
+1
-1
No files found.
dist/api.js
View file @
e9f9c414
...
@@ -164,7 +164,7 @@ async function tinifyOnce(input, type, cdnRoot) {
...
@@ -164,7 +164,7 @@ async function tinifyOnce(input, type, cdnRoot) {
return
;
return
;
}
}
const
buffer
=
await
(
0
,
compress_1
.
compressImage
)(
input
.
buffer
,
type
);
const
buffer
=
await
(
0
,
compress_1
.
compressImage
)(
input
.
buffer
,
type
);
console
.
log
(
'compressImage size:'
,
buffer
.
length
);
console
.
log
(
`compressImage size:
${
input
.
buffer
.
length
}
=>
${
buffer
.
length
}
`
);
if
(
cdnRoot
)
{
if
(
cdnRoot
)
{
const
cdnPath
=
path
.
join
(
cdnRoot
,
objectHash
(
buffer
)
+
input
.
extname
);
const
cdnPath
=
path
.
join
(
cdnRoot
,
objectHash
(
buffer
)
+
input
.
extname
);
return
(
0
,
ali_oss_duiba_1
.
uploadFile
)(
buffer
,
cdnPath
);
return
(
0
,
ali_oss_duiba_1
.
uploadFile
)(
buffer
,
cdnPath
);
...
...
dist/api.js.map
View file @
e9f9c414
This diff is collapsed.
Click to expand it.
src/api.ts
View file @
e9f9c414
...
@@ -166,7 +166,7 @@ async function tinifyOnce(input, type, cdnRoot) {
...
@@ -166,7 +166,7 @@ async function tinifyOnce(input, type, cdnRoot) {
return
return
}
}
const
buffer
=
await
compressImage
(
input
.
buffer
,
type
)
const
buffer
=
await
compressImage
(
input
.
buffer
,
type
)
console
.
log
(
'compressImage size:'
,
buffer
.
length
)
console
.
log
(
`compressImage size:
${
input
.
buffer
.
length
}
=>
${
buffer
.
length
}
`
)
if
(
cdnRoot
)
{
if
(
cdnRoot
)
{
const
cdnPath
=
path
.
join
(
cdnRoot
,
objectHash
(
buffer
)
+
input
.
extname
)
const
cdnPath
=
path
.
join
(
cdnRoot
,
objectHash
(
buffer
)
+
input
.
extname
)
return
uploadFile
(
buffer
,
cdnPath
)
return
uploadFile
(
buffer
,
cdnPath
)
...
...
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