Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
memoriav
Memobase 2020
services
postprocessing
Media Converter
Commits
9bb32724
Verified
Commit
9bb32724
authored
Feb 16, 2022
by
Sebastian Schüpbach
Browse files
fix convert string
parent
a04a7b94
Pipeline
#43115
passed with stages
in 6 minutes and 49 seconds
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
src/main/scala/ch/memobase/MediaTransformations.scala
View file @
9bb32724
...
...
@@ -91,22 +91,22 @@ object MediaTransformations extends Logging {
*/
def
createImageThumbnail
(
sourceFilePath
:
String
,
destFile
:
String
,
width
:
Option
[
Int
],
height
:
Option
[
Int
])
:
Try
[
String
]
=
{
val
externalCommand
=
s
"""convert
\\
|-filter Triangle
\\
|-define filter:support=2
\\
|-thumbnail ${width.getOrElse("")}x${height.getOrElse("")}
\\
|-unsharp 0.25x0.08+8.3+0.045
\\
|-dither None
\\
|-posterize 136
\\
|-quality 82
\\
|-define jpeg:fancy-upsampling=off
\\
|-define png:compression-filter=5
\\
|-define png:compression-level=9
\\
|-define png:compression-strategy=1
\\
|-define png:exclude-chunk=all
\\
|-interlace none
\\
|$sourceFilePath
\\
|$destFile"""
.
stripMargin
s
"""convert
|-filter Triangle
|-define filter:support=2
|-thumbnail ${width.getOrElse("")}x${height.getOrElse("")}
|-unsharp 0.25x0.08+8.3+0.045
|-dither None
|-posterize 136
|-quality 82
|-define jpeg:fancy-upsampling=off
|-define png:compression-filter=5
|-define png:compression-level=9
|-define png:compression-strategy=1
|-define png:exclude-chunk=all
|-interlace none
|$sourceFilePath
|$destFile"""
.
stripMargin
.
replaceAll
(
"\n"
,
" "
)
Try
{
executeCommand
(
externalCommand
)
destFile
...
...
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