Using an array of images created by php.
This line $name .= $filenames[$i].' '; adds all the image names together
e.g. eagle.jpg sunflower.jpg tower.jpg
This is basicly one large image created by ImageMagick containg all the
smaller images.
<?php
// Directory containing the images - need the trailing slash /
$dir = '../original_images/';
// Read the directory and select all jpg images
$filenames = glob($dir."*.jpg");
// Count the number of images to create the image list
$indexCount = count( $filenames );
for ( $i=0; $i<$indexCount; $i++ )
{
$name .= $filenames[$i].' ';
}
// Add a black frame and join all the images into one
exec("montage $name -tile x5 -frame 5 -shadow -geometry +5+5 frame_shadow.jpg");
?>