Example #1
0
 /**
  * Get the cache hash of an image
  *
  * @param Image $image
  *
  * @return string
  */
 public function getHashOf(Image $image)
 {
     $imagePath = $image->getOriginalImagePath();
     // Build the salt array
     $salts = $image->getSalts();
     $salts[] = $image->getQuality();
     $salts[] = md5($imagePath);
     $salts = serialize($salts);
     // Get image extension
     $extension = pathinfo($imagePath, PATHINFO_EXTENSION);
     return md5($salts) . '.' . $extension;
 }