Skip to content
Extraits de code Groupes Projets
Valider 9c16aea1 rédigé par Elliu's avatar Elliu
Parcourir les fichiers

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
......@@ -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"; }
__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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment