/** * {@inheritDoc} */ public function process(ResolverInterface $resolver) { $params = $resolver->getParameter(); $this->driver->setTargetSize($params['width'], $params['height']); switch ($params['mode']) { case static::IM_NOSCALE: break; case static::IM_RESIZE: $this->resize(); break; case static::IM_SCALECROP: $this->cropScale($params['gravity']); break; case static::IM_CROP: $this->crop($params['gravity'], $params['background']); break; case static::IM_RSIZEFIT: $this->resizeToFit(); break; case static::IM_RSIZEPERCENT: $this->resizePercentual($params['width']); break; case static::IM_RSIZEPXCOUNT: $this->resizePixelCount($params['width']); break; default: break; } foreach ($params['filter'] as $f => $parameter) { $this->addFilter($f, $parameter); } $this->driver->setQuality($this->compression); $this->driver->process(); }