Bash Script to resize images
One of my firends wanted this , so i explained him stepwise how to do it , then thought why not a script , here it is :
#! /bin/bash
ZENITY=/usr/bin/zenity
if hash zenity 2>/dev/null; then
if hash mogrify 2>/dev/null; then
loc=$(${ZENITY} --file-selection --title="Select a File" --directory)
cd $loc
pwd
mkdir resized
cp $loc/* $loc/rz/
cd rz
size=$(zenity --title "Give the required resize value" --entry --text "Resize value")
type=$(zenity --title "Give the file type you want to resize " --entry --text "File type")
mogrify -resize $size! *.$type | ( zenity --width=400 --height=100 --progress --title="Please wait " --text="......." --percentage=0)
zenity --info --text="Operation completed"
else
echo "Installing the dependcies"
sudo apt-get install imagemagick
sudo apt-get install zenity
exit 0;
fi
fi
Recent blog posts
- watir-webdriver web inspector
- gem list to gemfile
- Packing ruby2.0 on debian.
- Made it into The Guinness Book!
- to_h in ruby 2.0
- Filter elements by pattern jQuery.
- Better HTML password fields for mobile ?
- Grayscale image when user offline
- nth-child CSS pseudo-class Christmas colors
- EventEmitter in nodejs