Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
Motion Bank
Services
Transcoder
Commits
8fbe8e0c
Commit
8fbe8e0c
authored
Aug 22, 2018
by
A. Koch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update thumb generation
parent
a6f6b338
Pipeline
#1096
passed with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
8 deletions
+15
-8
src/lib/workers/concat.js
src/lib/workers/concat.js
+15
-8
No files found.
src/lib/workers/concat.js
View file @
8fbe8e0c
...
...
@@ -28,20 +28,27 @@ const concatJob = async function (job) {
}
catch
(
e
)
{
console
.
error
(
e
.
message
)
}
await
ffmpegThumb
(
destination
,
tmpDir
,
1
,
progress
=>
{
job
.
progress
(
4
0
+
progress
.
percent
*
0.
4
)
job
.
progress
(
6
0
+
progress
.
percent
*
0.
3
)
})
const
thumbFile
=
`
${
baseName
}
.p
n
g`
const
thumbFile
=
`
${
baseName
}
.
j
pg`
const
thumbPath
=
path
.
join
(
path
.
dirname
(
destination
),
thumbFile
)
await
fs
.
move
(
path
.
join
(
tmpDir
,
'
tn.png
'
),
thumbPath
,
{
overwrite
:
true
}
)
await
image
.
convert
(
path
.
join
(
tmpDir
,
'
tn.png
'
),
thumbPath
)
const
thumbFileSmall
=
`
${
baseName
}
-s.jpg`
const
thumbPathSmall
=
path
.
join
(
path
.
dirname
(
destination
),
thumbFileSmall
)
await
image
.
convert
(
path
.
join
(
tmpDir
,
'
tn.png
'
),
thumbPathSmall
,
{
resize
:
{
width
:
240
,
height
:
240
}
})
const
thumbFileMedium
=
`
${
baseName
}
-m.jpg`
const
thumbPathMedium
=
path
.
join
(
path
.
dirname
(
destination
),
thumbFileMedium
)
await
image
.
convert
(
path
.
join
(
tmpDir
,
'
tn.png
'
),
thumbPathMedium
,
{
resize
:
{
width
:
640
,
height
:
640
}
})
const
minioClient
=
new
Minio
.
Client
(
config
.
assets
.
client
)
await
minioClient
.
fPutObject
(
config
.
assets
.
bucket
,
destFile
,
destination
,
{
'
Content-Type
'
:
'
video/mp4
'
})
await
minioClient
.
fPutObject
(
config
.
assets
.
bucket
,
thumbFile
,
thumbPath
,
{
'
Content-Type
'
:
'
image/png
'
})
await
minioClient
.
fPutObject
(
config
.
assets
.
bucket
,
thumbFile
,
thumbPath
,
{
'
Content-Type
'
:
'
image/jpeg
'
})
await
minioClient
.
fPutObject
(
config
.
assets
.
bucket
,
thumbFileSmall
,
thumbPathSmall
,
{
'
Content-Type
'
:
'
image/jpeg
'
})
await
minioClient
.
fPutObject
(
config
.
assets
.
bucket
,
thumbFileMedium
,
thumbPathMedium
,
{
'
Content-Type
'
:
'
image/jpeg
'
})
await
fs
.
remove
(
tmpDir
)
...
...
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