/**
  * Find all files in the sfImagePool filesystem with the given
  * name (i.e. all the resized versions) and delete them.
  * 
  * Also need to delete sfImagePoolCrops - as the image itself has changed
  * this will handle deleting off the cloud
  * 
  * @param string $filename Old file to delete
  */
 public function deleteCached($filename, $image = null)
 {
     $count = sfImagePoolUtil::deleteImageFile($filename);
     if ($image) {
         $crops = $image->getCrops();
         if (0 < $crops->count()) {
             foreach ($crops as $crop) {
                 // Delete crop - interfaces with Cache
                 $crop->delete();
                 $crop->free();
             }
         }
     }
 }
 /**
  * Delete files in image pool folder - including all thumbnails
  * This is used by all cache implementations as the original file is stored on the filesystem
  * The main delete is only used to remove files if no crop sent through
  * 
  * @author Jo Carter
  */
 public function delete(sfImagePoolCrop $crop = null)
 {
     if (!is_null($crop)) {
         $count = sfImagePoolUtil::deleteImageFile($this->image['filename']);
     }
 }