if ($isNameChanged ||
$isAlbumChanged) { // To remove the old thumbnails, use the old name.
$name =
isset($changeSet['name'
]) ?
$changeSet['name'
][0
] :
$this->name;
$name =
$this->
removeSpecialCharacters($name);
$name =
$name . '.' .
$this->extension;
// To remove the old album thumbnails, use the old album
$album =
isset($changeSet['album'
]) ?
$changeSet['album'
][0
] :
$this->album;
if ($isNameChanged) { // Remove default thumbnails
$this->
removeDefaultThumbnails($name);
// Create default thumbnails
$this->
createDefaultThumbnails();
} // Remove the configured album thumbnail files
$settings =
$album->
getSettings();
if ($settings !== null
) { $this->
removeAlbumThumbnails($settings->
getThumbnailSize(),
$name);
}