Ejemplo n.º 1
0
 public function createImageFromFile($filename, $mime = '', $adapter = null)
 {
     if (!file_exists($filename) || !is_readable($filename)) {
         throw new ImageTransformException(sprintf('Unable to load %s. File does not exist or is unreadable', $filename));
     }
     if (empty($adapter)) {
         $adapter = $this->defaults['default_adapter'];
     }
     $image = new Image($adapter);
     if ($mime == '') {
         $mime = $this->autoDetectMIMETypeFromFile($filename);
     }
     return $image->load($filename, $mime);
 }