Image resize (batch)

Nautilus Scripts

Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net

1
Score 53.3%
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

10 years ago

what theme did You use ?

Report

C

hemanth

10 years ago

New wave on jaunty as far as my memory is right

Report

C

hemanth

10 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

10 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

12345678910
11
product-maker I4C Feb 19 2013 3 bad
product-maker sadi Aug 09 2012 9 excellent
product-maker Count: 4 Rating: 5.0
File (click to download) Version Description Downloads Date Filesize DL OCS-Install
Pling
*Needs ocs-url or ocs-store to install things
Details
license
version
beta
updated Jun 07 2009
added Jun 07 2009
downloads today
0
page views today 6
System Tags addon