
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 existif (! -d /tmp/foo100) then mkdir -p /tmp/foo100endif
# Iterate over each jpg file in the current directoryforeach 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 endifend
Read Next
30 Oct 2005
Place de la Concorde
Execution Site During the French Revolution
11 Oct 2005
Migrating rrd database between different architecture
Another Tech note