From: Danilo M. Date: Thu, 30 Apr 2026 07:12:35 +0000 (+0200) Subject: translate: fixed translation for "gify - back to bash scripting" X-Git-Tag: release_30042026-1254~29 X-Git-Url: https://git.danix.xyz/?a=commitdiff_plain;h=5dbeaee17d8133eb77804b86ff73542d28062ac4;p=danix.xyz-2.git translate: fixed translation for "gify - back to bash scripting" --- diff --git a/content/en/articles/gify-back-to-bash-scripting/index.md b/content/en/articles/gify-back-to-bash-scripting/index.md index 24e8834..c34fb13 100644 --- a/content/en/articles/gify-back-to-bash-scripting/index.md +++ b/content/en/articles/gify-back-to-bash-scripting/index.md @@ -1,11 +1,12 @@ +++ -title = "gify.sh – back to bash scripting" +title = "gify.sh - back to bash scripting" author = "Danilo M." type = "tech" date = "2016-01-25T12:41:06+00:00" image = "/uppies/2016/01/G0092546.jpg" categories = [ "Code", "DIY", "Photography"] tags = [ "bash", "convert", "gif", "imagemagik", "mogrify", "script"] + +++ {{< image class="max-w-lg mx-auto" src="/uppies/2016/01/piscaturi.gif" alt="piccoli pescatori crescono" caption="gif image created using gify.sh" >}}{{< /image >}} diff --git a/content/it/articles/gify-back-to-bash-scripting/index.md b/content/it/articles/gify-back-to-bash-scripting/index.md index a0ed9a6..f5c035c 100644 --- a/content/it/articles/gify-back-to-bash-scripting/index.md +++ b/content/it/articles/gify-back-to-bash-scripting/index.md @@ -1,12 +1,233 @@ +++ -title = "gify.sh – back to bash scripting" -date = "2016-01-25T12:41:06+00:00" - +title = "gify.sh - si torna a programmare in Bash." +author = "Danilo M." type = "tech" -tags = ["bash", "convert", "gif", "imagemagik", "mogrify", "script"] +date = "2016-01-25T12:41:06+00:00" image = "/uppies/2016/01/G0092546.jpg" -author = "Danilo M." - +categories = [ "Code", "DIY", "Photography"] +tags = ["bash", "convert", "gif", "imagemagik", "mogrify", "script"] +++ +{{< image class="max-w-lg mx-auto" src="/uppies/2016/01/piscaturi.gif" alt="piccoli pescatori crescono" caption="gif image created using gify.sh" >}}{{< /image >}} + +Oggi vi presenterò uno script utile che vi aiuterà a creare fantastiche GIF a partire dalle vostre foto, utilizzando alcuni strumenti della suite [IMAGEMAGIK](https://www.imagemagick.org). Quindi, senza ulteriori indugi, ecco lo script, preso direttamente dai repository di GitHub. + +{{< actions url="https://gist.github.com/danixland/624f77c70c9e19ce7cf9/archive/26746be7f7009f82e4246a8bc0e5728954d0ac8b.zip" desc="Download as ZIP archive" outclass="special" inclass="primary" >}} + +Il codice è piuttosto semplice: accetta alcuni argomenti e vi aiuta a ridimensionare le immagini mantenendo le proporzioni originali. Inserite il codice nella cartella desiderata e mettetelo subito in funzione. + + + +Per questo esempio, immaginiamo di avere una serie di foto in formato JPG, magari scattate durante un viaggio in Francia. Mettetele in una cartella ed eseguite lo script come segue: + +```bash +gify.sh --resize 900 jpg +``` + +A seconda del numero di immagini, l'operazione potrebbe richiedere un po' di tempo. Al termine, tutte le vostre immagini JPG saranno ridimensionate a una larghezza di 900 pixel e con un'altezza proporzionale. + +Ora è il momento di convertire tutte le vostre immagini JPG in un'unica GIF animata. Quindi, rimanendo nella stessa cartella, eseguite lo script come segue: + +```bash +gify.sh --gif 10 jpg paris +``` + +I parametri ora sono leggermente diversi. Innanzitutto, indichiamo allo script che vogliamo creare una GIF con l'opzione `--gif`. Quindi, indichiamo l'intervallo tra ogni fotogramma, espresso in centesimi di secondo. In questo caso, stiamo dicendo alla GIF di cambiare fotogramma ogni 10/100 di secondo. Il parametro successivo è l'estensione delle immagini che utilizzeremo. Nel nostro esempio, è JPG (la distinzione tra maiuscole e minuscole è importante, quindi assicuratevi che tutte le immagini che volete utilizzare abbiano la stessa estensione). Infine, impostiamo il nome della GIF, senza l'estensione; lo script la aggiungerà automaticamente. + +La GIF che vedete all'inizio dell'articolo è stata creata con questo script. + +Ho creato questo script principalmente per divertimento e per uso personale, quindi non è assolutamente perfetto. Può essere migliorato, ma per me funziona benissimo. Se volete modificarlo, sentitevi liberi di copiarlo da GitHub o semplicemente di scaricarlo e fare ciò che desiderate. E se volete condividerlo con me, utilizzate il modulo di commento qui sotto. + +Vi lascio una copia dello script qui sotto, nel caso in cui vogliate dare un'occhiata prima di scaricarlo. +Buon divertimento! + +```bash +#! /bin/bash + +# Author: Danilo 'danix' Macri +# Author URI: https://danix.xyz +# Script URI: https://danix.xyz/?p=3545 +# License: GPL2 +# License URI: https://www.gnu.org/licenses/gpl-2.0.html + +#--------------------------------------------------------------------------------# +# # +# GIFY.SH - CREATE ANIMATED GIFS OUT OF A BUNCH OF IMAGES # +# # +# Use this script to create animated looping gifs from a bunch of images. You # +# just need to arrange all the images you want to use inside a folder and then # +# launch this script with a few options and you'll have your gif within seconds. # +# # +# This script uses mogrify and convert from the IMAGEMAGIK suite to deliver the # +# gifs. This script can proportionally resize your images to help you create a # +# lighter file. # +# # +#--------------------------------------------------------------------------------# + +# ERROR & EXIT STATUSES # +SHOWHELP=61 +USERABORTED=62 + +E_INTERROR=71 +E_NOOPTS=72 +E_NOARGS=73 +E_FILEXISTS=74 +E_NOIMAGES=75 +E_UNKNOWNOPT=76 + +# TOOLS # +PWD=$(pwd) +MOGRIFY=$(which mogrify) +CONVERT=$(which convert) + +# we need mogrify and convert from the imagemagik toolset for this script to work # +if [[ ! -x $MOGRIFY || ! -x $CONVERT ]]; then + showerror missingdeps + exit $E_MISSINGDEPS +fi + + +# showhelp # +showhelp () +{ +case $1 in + resize ) + echo "USAGE: $(basename $0) -r | --resize [width] [extension]" + ;; + gif ) + echo "USAGE: $(basename $0) -g | --gif [delay] [extension] [output file name]" + ;; + * ) + #|----------------------- TEXT MAX WIDTH - 80 CHARS ----------------------------| + echo -e "$(basename $0) - create animated gifs from images inside current directory" + echo -e "USAGE: $(basename $0)