/**
* Delete the relative file, and any thumbnails.
* @param string $relative the relative file.
* @return boolean true if deleted, false otherwise.
*/
function _delFile($relative)
{
$fullpath = Files::makeFile($this->getImagesDir(), $relative);
//check that the file is an image
if ($this->config['validate_images'] == true) {
if (!is_array($this->getImageInfo($fullpath))) {
return false;
}
//hmmm not an Image!!???
}
$thumbnail = $this->getThumbName($fullpath);
if (Files::delFile($fullpath)) {
return Files::delFile($thumbnail);
} else {
return false;
}
}