class JPG_byDir
{
var $ImgArray;
function JPG_byDir($in_dir)
{
/* -------------------------------------------------------------------------------------------------------- */
/* Global Variables */
/* -------------------------------------------------------------------------------------------------------- */
$pattern1 = "*.jpg";
$pattern2 = "*.JPG";
$X = 1;
/* -------------------------------------------------------------------------------------------------------- */
/* Capture Images from Directory into an Array */
/* -------------------------------------------------------------------------------------------------------- */
$save_dir = getcwd();
chdir($in_dir);
$dir = opendir($in_dir);
// $files = glob($pattern1);
// $files = glob($pattern2);
foreach (glob($pattern1) as $file)
{
$this->ImgArray[$X] = $file;
$X = $X+ 1;
}
foreach (glob($pattern2) as $file)
{
$this->ImgArray[$X] = $file;
$X = $X+ 1;
}
closedir($dir);
chdir($save_dir);
return $this->ImgArray;
}
}
?>