public static function generateThumbnails($path, $sourceFile)
{
// get folder listing
$folders = self::getThumbnailFolders($path);
$filename = basename($sourceFile);
// loop folders
foreach ($folders as $folder) {
// generate the thumbnail
$thumbnail = new \SpoonThumbnail($sourceFile, $folder['width'], $folder['height']);
$thumbnail->setAllowEnlargement(true);
// if the width & height are specified we should ignore the aspect ratio
if ($folder['width'] !== null && $folder['height'] !== null) {
$thumbnail->setForceOriginalAspectRatio(false);
}
$thumbnail->parseToFile($folder['path'] . '/' . $filename);
}
}