Profile picture for Admin

What is this about?

 Have photos from your camera and want to share them online, but in a way that leaves you some webspace and those people who want to see them some bandwith? This linux script batch converts all images in the current directory to 640 times 480 (or 480x640, as appropriate), but you can of course easily modify this target size. Everything very basic, though I could not find a ready script online.
 If you don't have an automatic slideshow script yet you might want to use this one.

The batch conversion script

 The script should work on all standard Linux distributions. Simply copy the following text, put into a new text file. Save that file, ideally in some directory that is searched for commands (one of your $PATH dirs) and give it the "executable" flag.#!/bin/bash
echo "This will resize all jpg images in the current directory to 640x480 (or 480x640, as appropriate), an optional paramter will be prefixed to result files."
for i in *.jpg ;
do
SIZEX=$(identify $i | egrep -o '[0-9]+x' | egrep -o '[0-9]+')
SIZEY=$(identify $i | egrep -o 'x[0-9]+' | egrep -o '[0-9]+')
if(test $SIZEX -ge $SIZEY;)then
  convert -size 640x480 $i -resize 640x480 $1_$i;
else
  convert -size 480x640 $i -resize 480x640 $1_$i;
fi
echo "resized image $1_$i created." ;
done

source:
http://panmental.de/public/programming_projects/HowTos/batchResizePics.htm

Добавить комментарий

Содержимое данного поля является приватным и не предназначено для показа.
 .d8888P   88888888b  dP    dP  .d888b.  dP   dP   dP 
88' 88 Y8. .8P Y8' `88 88 88 88
88baaa. a88aaaa Y8aa8P `8bad88 88 .8P .8P
88` `88 88 d8' `8b `88 88 d8' d8'
8b. .d8 88 88 88 d. .88 88.d8P8.d8P
`Y888P' dP dP dP `8888P 8888' Y88'

Введите код, изображенный в стиле ASCII-арт.