
Quick and dirty way of creating photo album with imagemagick, creating
images with black border as it looks good for all
#!/bin/csh
# Create the output directory if it doesn't exist
if (! -d /tmp/foo100) then
mkdir -p /tmp/foo100
endif
# Iterate over each jpg file in the current directory
foreach file ( [0-9]*.jpg )
# Get the width and height of the image
set w = `identify -format "%w" $file`
set h = `identify -format "%h" $file`
# Resize the image based on its orientation and add a black border
if ($w > $h) then
convert $file -thumbnail 500x -bordercolor black -border 1 /tmp/foo100/$file
else
convert $file -thumbnail x500 -bordercolor black -border 1 /tmp/foo100/$file
endif
end
Read Next
30 Oct 2005
Place de la Concorde
Execution Site During the French Revolution
10 Nov 2005
Diwali at Paris
Other kind of Fireworks