// Is image media?
if ($this->type !== self::TYPE_IMAGE
) { return;
} // Check if the album has loaded correctly and should be created for the album thumbnails?
if ($album->
getSettings() === null || !
$album->
getSettings()->
getCreateThumbnails()) { return;
} $defaultSizes =
$this->
getDefaultThumbnails();
$defaultSize =
implode('x',
$defaultSizes[0
]);
// Load the configured album thumbnail sizes
$sizes =
$album->
getSettings()->
getThumbnailSize();
$sizes[] =
$defaultSize;
// Iterate the sizes and create the thumbnails
foreach ($sizes as $size) { // Split the width and height (example: $size = 70x70)
$data =
explode('x',
$size);
// To avoid any confusing, we're mapping the index based to an association based array and remove the index based elements.