protected function generateThumbnail($image)
 {
     $ext = strtolower(preg_replace('/.*\\.([^.]+)$/', '$1', $image));
     $config = $this->getApplication()->getConfiguration();
     $cacheThumb = $this->imageFinder->getThumbnailFileName($image, '.jpg');
     $imageThumbSize = empty($config['thumbnails.size']) ? 230 : $config['thumbnails.size'];
     $this->imageFinder->ensureFodlerExists(dirname($cacheThumb));
     $ret = $this->image->makeThumbnail($image, $cacheThumb, $imageThumbSize);
     $this->imageFinder->ensureFileMode($cacheThumb);
     return $ret;
 }
Ejemplo n.º 2
0
 public function doRun(InputInterface $input, OutputInterface $output)
 {
     $input->bind($this->getDefinition());
     $options = $input->getOptions();
     $this->setConfigurationOverride($options['config']);
     $this->setCatchExceptions(true);
     $imageFinder = new Image\Finder($this);
     $image = Image\Image::createFromConfig($this->getConfiguration());
     $this->get('install:assets')->inject($imageFinder);
     $this->get('refresh:thumbnails')->inject($image, $imageFinder);
     $this->get('refresh:covers')->inject($image, $imageFinder);
     $this->get('refresh:json')->inject($imageFinder);
     return parent::doRun($input, $output);
 }