J'ai le script suivant nommé wallpaperise.sh qui prend une image et la convertit en la même chose cette fois-ci avec une résolution 16: 9.Le script de réduction d'image crée une image de plus grande taille dans Linux
## Usage: ./wallpaperise.sh <imagename.jpg>
aw=16 #desired aspect ratio width...
ah=9 #and height
in="$1"
out="wallpaperised_$1"
wid=`convert "$in" -format "%[w]" info:`
hei=`convert "$in" -format "%[h]" info:`
tarar=`echo $aw/$ah | bc -l`
imgar=`convert "$in" -format "%[fx:w/h]" info:`
if (($(bc <<< "$tarar > $imgar")))
then
nhei=`echo $wid/$tarar | bc`
convert "$in" -gravity center -crop ${wid}x${nhei}+0+0 "$out"
elif (($(bc <<< "$tarar < $imgar")))
then
nwid=`echo $hei*$tarar | bc`
convert "$in" -gravity center -crop ${nwid}x${hei}+0+0 "$out"
else
cp "$in" "$out"
fi
Le problème est que l'image qu'il crée (même si elle ne change pas l'image du tout) est d'une plus grande taille de fichier que l'original?
Que puis-je faire pour résoudre ce problème?