$sizes =
explode('x',
$size);
return ['width' =>
(int) $sizes[0
], 'height' =>
(int) $sizes[1
]];
} /**
* @throws Exception
*/
private function getThumbnailSizesFromMedia(Media
$media): array
{ $settings =
$media->
getAlbum()->
getSettings();
if (!
$settings instanceof Settings
) { throw new Exception('No settings configured in the album of the given media object!'
);
} $thumbnailSizes =
$settings->
getThumbnailSize();
// When no sizes are defined in the album
if (empty($thumbnailSizes) ||
empty($thumbnailSizes[0
])) { $thumbnailSizes =
[];
}