You are here

public function ImagemagickToolkit::save in ImageMagick 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/ImageToolkit/ImagemagickToolkit.php \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::save()
  2. 8.2 src/Plugin/ImageToolkit/ImagemagickToolkit.php \Drupal\imagemagick\Plugin\ImageToolkit\ImagemagickToolkit::save()

Writes an image resource to a destination file.

Parameters

string $destination: A string file URI or path where the image should be saved.

Return value

bool TRUE on success, FALSE on failure.

Overrides ImageToolkitInterface::save

File

src/Plugin/ImageToolkit/ImagemagickToolkit.php, line 953

Class

ImagemagickToolkit
Provides ImageMagick integration toolkit for image manipulation.

Namespace

Drupal\imagemagick\Plugin\ImageToolkit

Code

public function save($destination) {
  $this
    ->setDestination($destination);
  if ($ret = $this
    ->convert()) {

    // Allow modules to alter the destination file.
    $this->moduleHandler
      ->alter('imagemagick_post_save', $this);

    // Reset local path to allow saving to other file.
    $this
      ->setDestinationLocalPath('');
  }
  return $ret;
}