Image resize (batch)

Nautilus Scripts

Source (required if based on other people's work):

1
Score 62%
Description:

Using zenity and mogrify to resize images , give the size as H x W
Ex : 640x480

sadi

6 years ago

I think this very useful script maybe improved if it can run by right clicking a folder without selection window.
There is also a typo concerning "resized" folder which results in original files being overwritten.
So here is my suggestion:
===============================

if hash zenity 2>/dev/null; then
if hash mogrify 2>/dev/null; then
loc=$(${ZENITY} --file-selection --title="Select a Folder" --directory)
cd $loc
pwd
mkdir $loc/resized/
cp $loc/* $loc/resized/
cd resized
size=$(zenity --title "New Size" --entry --text "Please enter the new size as WxH")
type=$(zenity --title "File Type" --entry --text "Please enter type of files to resize")
mogrify -resize $size! *.$type | ( zenity --width=400 --height=100 --progress --title="Please wait until OK..." --percentage=1)
else
echo "Please install the dependencies imagemagick and zenity"
exit 0;
fi
fi

Report

cdar07

9 years ago

what theme did You use ?

Report

C

hemanth

9 years ago

New wave on jaunty as far as my memory is right

Report

C

hemanth

9 years ago

kramp thanks for the advice no the script in changed as you have suggested, still more improvements and suggestions is always welcomed so the script , becomes full stable
and the user is advice to run the script as a root, but as you have mentioned they might not have permissions.

Report

kramp

9 years ago

in your script:

echo "Installing the dependcies"
sudo apt-get install imagemagick
sudo apt-get install zenity

You should change these lines, and just display an error, for the following reasons:
- the user may not have the sudoers rights
- your script might work on other packages systems

Or at least ask the user to confirm the dependencies install

Report

product-maker I4C Feb 19 2013

product-maker sadi Aug 09 2012

product-maker 6 14

File (click to download) Version Description Packagetype Architecture Downloads Date Filesize DL OCS-Install
Pling
Details
license
version
beta
updated Jun 07 2009
added Jun 07 2009
downloads today
0
page views today 1
System Tags addon