Convertire immagini da riga di comando
Oggi è giornata da «riga di comando» pare...
Beh ecco uno «scrippettino» in bash che vi scala (alla dimensione voluta) tutte le immagini presenti in una cartella. Usa il comando convert delle librerie ImageMagick.
#!/bin/bash
mkdir convertite
if [ $? == 0 ]; then
for immagine in `ls *.jpg`
do
convert $immagine -scale 400x267 convertite/$immagine
done
fi
exit 0
Per usarlo, occorre un chmod a+x al file creato e il posizionamento nella directory con le immagini da convertire.
Write a comment
If you want to add your comment on this post, simply fill out the next form:
* Required fields
You can use these XHTML tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>.
No comments
Be the first to write a comment on this post.
No trackbacks
To notify a mention on this post in your blog, enable automated notification (Options > Discussion in WordPress) or specify this trackback url: http://www.linuxchronicles.com/linux/convertire-immagini-da-riga-di-comando/trackback/