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

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

Содержимое данного поля является приватным и не предназначено для показа.
  • HTML-теги не обрабатываются и показываются как обычный текст
 d88   dP     dP   a88888b.   .d888888    .88888.  
88 88 .d8' d8' `88 d8' 88 d8' `88
88 88aaa8P' 88 88aaaaa88a 88
88 88 `8b. 88 88 88 88 YP88
88 88 88 Y8. .88 88 88 Y8. .88
d88P dP dP Y88888P' 88 88 `88888'

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