/** * (non-PHPdoc) * @see Imagine\Image\ManipulatorInterface::save() */ public function save($path, array $options = array()) { try { if (isset($options['format'])) { $this->imagick->setimageformat($options['format']); } $this->applyImageOptions($this->imagick, $options); $this->imagick->writeImage($path); } catch (\ImagickException $e) { throw new RuntimeException('Save operation failed', $e->getCode(), $e); } return $this; }
/** * {@inheritdoc} */ public function save($path, array $options = array()) { try { if (isset($options['format'])) { $this->imagick->setimageformat($options['format']); } $this->applyImageOptions($this->imagick, $options); // flatten only if image has multiple layers if ($this->imagick->hasNextImage() || $this->imagick->hasPreviousImage()) { $this->flatten(); } $this->imagick->writeImage($path); } catch (\ImagickException $e) { throw new RuntimeException('Save operation failed', $e->getCode(), $e); } return $this; }
/** * {@inheritdoc} */ public function save($path, array $options = array()) { try { if (isset($options['format'])) { $this->imagick->setimageformat($options['format']); } $this->layers()->merge(); $this->applyImageOptions($this->imagick, $options); // flatten only if image has multiple layers if ((!isset($options['flatten']) || $options['flatten'] === true) && count($this) > 1) { $this->flatten(); } $this->imagick->writeImage($path); } catch (\ImagickException $e) { throw new RuntimeException('Save operation failed', $e->getCode(), $e); } return $this; }