Create one large image containing all the jpg images in a file.
The file name is added to the image.
<?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].' ';
}
exec("montage -label \"%f\" $name -frame 5 -geometry 100x100 php_list4.jpg");
?>