Pages : 1
#1 Le 10/05/2006, à 11:49
- benjou
script resize pour rox-filer
Basé sur le script nautilus de Matthieu Vilaplana
à copier dans le fichier ~/.config/rox.sourceforge.net/SendTo/.image_png/redimmensionner
#! /bin/sh
# Author : Mathieu Vilaplana <mathieu@creationgif.com>, Benoit Kornmann
# Date : 07/03/2005
#depends: imagemagick, zenity
# thanks to coffe
#version 0.2
if [ $# -eq 0 ]; then
zenity --error --title="error" --text="You must select at least 1 file to process"
exit 1
fi
title="Choose which sizes to scale to"
imgsize=`zenity --title "$title" --list --separator=" " --column="size" "160x120" "320x240" "640x480" "800x600" "1024x768" | sed 's/ max//g' `
#if $? != 0, user click on cancel button, so exit
if [ "$?" != 0 ] ; then
exit
fi
if [ ! "$imgsize" ]; then
zenity --error --title="error" --text="select a target size"
exit
fi
#transform 640x480 en 640x640
val1=`echo "$imgsize" | awk -F'x' '{ print $1 }'`
imgsize="${val1}x${val1}"
newfile=$(echo "$@""$imgsize"".png")
convert -quality 80 -resize $imgsize "$@" "$newfile"
et à copier dans le fichier ~/.config/rox.sourceforge.net/SendTo/.image_jpeg/redimmensionner :
#! /bin/sh
# Author : Mathieu Vilaplana <mathieu@creationgif.com>, Benoit Kornmann
# Date : 07/03/2005
#depends: imagemagick, zenity
# thanks to coffe
#version 0.2
if [ $# -eq 0 ]; then
zenity --error --title="error" --text="You must select at least 1 file to process"
exit 1
fi
title="Choose which sizes to scale to"
imgsize=`zenity --title "$title" --list --separator=" " --column="size" "160x120" "320x240" "640x480" "800x600" "1024x768" | sed 's/ max//g' `
#if $? != 0, user click on cancel button, so exit
if [ "$?" != 0 ] ; then
exit
fi
if [ ! "$imgsize" ]; then
zenity --error --title="error" --text="select a target size"
exit
fi
#transform 640x480 en 640x640
val1=`echo "$imgsize" | awk -F'x' '{ print $1 }'`
imgsize="${val1}x${val1}"
newfile=$(echo "$@""$imgsize"".jpg")
convert -quality 80 -resize $imgsize "$@" "$newfile"
ensuite il suffit de clicker-droit sur une image et choisir 'rediemensioner': Un dialogue apparait et permet de redimensionner l'image...
écrasons l'infâme
Hors ligne