Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Matrix Stickers
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Colgatto
Matrix Stickers
Validations
9c16aea1
Valider
9c16aea1
rédigé
9 sept. 2022
par
Elliu
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Remove progress printing
parent
cae03c48
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
stpkg
+3
-21
3 ajouts, 21 suppressions
stpkg
avec
3 ajouts
et
21 suppressions
stpkg
+
3
−
21
Voir le fichier @
9c16aea1
...
...
@@ -189,7 +189,6 @@ __upload_file() {
}
picture_process_sticker
()
{
# NOTE: This command will display some progress dots...
local
FILE
=
$1
# The source file
local
DEST
=
$2
# The destination file
local
NAME
=
$3
# The pretty name of the sticker
...
...
@@ -204,17 +203,16 @@ picture_process_sticker() {
info
"File '
$FILE
' => '
$DEST
' (
$TYPE
) | OPTS = '
$OPTS
'"
convert
"
$FILE
"
-bordercolor
none
-border
1
"
$DEST
"
1>&2
&&
progress_dot
||
die
"
$NAME
failed on border"
convert
"
$DEST
"
-trim
${
repage
}
"
$DEST
"
1>&2
&&
progress_dot
||
die
"
$NAME
failed on trim"
convert
"
$FILE
"
-bordercolor
none
-border
1
"
$DEST
"
1>&2
||
die
"
$NAME
failed on border"
convert
"
$DEST
"
-trim
${
repage
}
"
$DEST
"
1>&2
||
die
"
$NAME
failed on trim"
convert
-background
none
-gravity
center
"
$DEST
"
${
resize
}
$OPTS
"
$DEST
"
1>&2
\
&&
progress_dot
\
||
die
"
$NAME
failed on
${
WIDTH
}
x
${
HEIGHT
}
resize"
}
picture_resize_preview
()
{
local
DEST
=
$1
# The file
local
NAME
=
$2
# The pretty name for the sticker
convert
"
$DEST
"
-resize
"128x128"
"
$DEST
"
1>&2
&&
progress_dot
||
die
"
$NAME
failed at 128x128 resize"
convert
"
$DEST
"
-resize
"128x128"
"
$DEST
"
1>&2
||
die
"
$NAME
failed at 128x128 resize"
}
create_sticker_json
()
{
...
...
@@ -578,8 +576,6 @@ __list() {
done
}
# Results are on stdout and progress on stderr. Note that
# if the stderr of stpkg is redirected, progress messages will be lost.
# Usage: process_sticker_file <filename> <&JSON>
process_sticker_file
()
{
FILE
=
"
$1
"
...
...
@@ -621,17 +617,12 @@ process_sticker_file() {
fi
local
DEST
=
"
$DEST_FOLDER
/
$NAME
.
$DSTTYPE
"
# For the progress
#progress "($CURRENT_FILE/$TOTAL_FILES) $NAME "
#local CURRENT_FILE=$[ $CURRENT_FILE + 1 ]
if
[
"x
${
STPKG_NOCONVERT_FILE
}
"
=
"xyes"
]
;
then
#
# Don't convert image, upload it as it is
#
local
DEST_TYPE
=
$INIT_TYPE
cp
${
FILE
}
${
TEMP
}
progress_dot
else
if
[[
${
animatedFiletype
[
$INIT_EXT
]
}
]]
;
then
...
...
@@ -642,14 +633,11 @@ process_sticker_file() {
local
DEST_EXT
=
$(
file_get_ext_from_type
"
$DEST_TYPE
"
)
convert
"
${
FILE
}
"
-coalesce
-background
none
-trim
-layers
TrimBounds
"
$DEST_EXT
:
${
TEMP
}
"
1>&2
\
&&
progress_dot
\
||
die
"
$NAME
failed trimming the sticker"
convert
"
${
TEMP
}
"
-coalesce
-dispose
Background
-resize
${
DEST_WIDTH
}
x
${
DEST_HEIGHT
}
"
$DEST_EXT
:
${
TEMP
}
"
1>&2
\
&&
progress_dot
\
||
die
"
$NAME
failed resizing the sticker"
#convert "${TEMP}" -coalesce -layers OptimizePlus -layers RemoveDups -layers OptimizeTransparency "$DEST_EXT:${TEMP}" 1>&2 \
convert
"
${
TEMP
}
"
-coalesce
-layers
Optimize
"
$DEST_EXT
:
${
TEMP
}
"
1>&2
\
&&
progress_dot
\
||
die
"
$NAME
failed optimizing the sticker"
else
...
...
@@ -660,7 +648,6 @@ process_sticker_file() {
local
DEST_EXT
=
$(
file_get_ext_from_type
"
$DEST_TYPE
"
)
convert
"
$FILE
"
-bordercolor
none
-border
1
-background
none
-gravity
center
-trim
+repage
-resize
${
DEST_WIDTH
}
x
${
DEST_HEIGHT
}
"
${
DEST_EXT
}
:
${
TEMP
}
"
1>&2
\
&&
progress_dot
\
||
die
"
$NAME
failed converting the sticker"
fi
...
...
@@ -673,7 +660,6 @@ process_sticker_file() {
# Upload the transformed file
local
MXC
=
$(
__upload_file
"
$DEST_TYPE
"
"
$TEMP
"
"
$NAME
"
)
rm
"
$TEMP
"
progress_dot
JSON_REF
=
$(
create_sticker_json
"
$PACK_NAME
"
"
$NAME
"
"
$DEST_WIDTH
"
"
$DEST_HEIGHT
"
"
$DEST_TYPE
"
"
$MXC
"
)
}
...
...
@@ -752,9 +738,6 @@ __default() {
default_index
>
$STPKG_INSTALL
/web/packs/index.json
||
die
"Failed to create default index.json file"
}
progress
()
{
echo
1>&2
-n
"
$*
"
;
}
progress_dot
()
{
progress
'.'
;
}
progress_reset
()
{
echo
1>&2
-en
"
\r
[2K"
;
}
__pack
()
{
# The pack source folder and the pack name
if
[
$#
-eq
1
]
;
then
...
...
@@ -871,7 +854,6 @@ __pack() {
local
report
=
"
`
echo
-ne
"
$ST_JSON
"
| jq
-r
'[.body, .url, .info.mimetype, .info.w, .info.h]|join(" ")'
`
$STICKER_STATUS
"
echo
"
$report
"
progress_reset
done
| column
-t
# Update the sum file:
# Keep deleted but kept
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Please
se connecter
to comment