public function generateImagesFromFile($file) { if (!$this->finder->setFile($file)) { $this->log->error("Invalid file {$file}"); return $this; } foreach ($this->finder->searchImages() as $url_string) { $image_url = new ImageUrl(); $image_url->setBaseUrl($this->config['url']); $image_url->setRootPath($this->root_path); $image_url->setImageDirectories($this->config['images-directories']); $image_url->setFileArgumentsSeperator($this->config['file-arguments-seperator']); $image_url->setArgumentSeperator($this->config['argument-seperator']); $image_url->setUrl($url_string); try { $image_url->make(); } catch (\RuntimeException $e) { $this->log->error($e->getMessage()); continue; } $this->log->line("Created: {$url_string}"); } $this->log->info('Done!'); return $this; }
/** * Get a picture Object * * @var string * @return string */ public function picture($file, $params = array()) { $img_url = new Image\ImageUrl(); $img_url->setFile($file); $pic = new Image\Picture($this->config, $img_url); $pic->addParams($params); return $pic; }