Reads a directory, only puts jpg files into an array and joins the images together.
To get the images vertical use -append
<?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("convert -mattecolor black -frame 5x5+2+2 $name +append php_list.jpg");
?>