image_save

  1. drupal
    1. drupal7
Versionen
drupal7 image_save(stdClass $image, $destination = NULL)

Close the image and save the changes to a file.

see image_load()

Übergabeparameter

$image An image object returned by image_load(). The object's 'info' property will be updated if the file is saved successfully.

$destination Destination path where the image should be saved. If it is empty the original image file will be overwritten.

Rückgabewert

TRUE or FALSE, based on success.

See also

image_gd_save()

Verwandte Themen

▾ 3 functions call image_save()

file_validate_image_resolution in includes/file.inc
If the file is an image verify that its dimensions are within the specified maximum and minimum dimensions.
ImageToolkitGdTestCase::testManipulations in modules/simpletest/tests/image.test
Since PHP can't visually check that our images have been manipulated properly, build a list of expected color values for each of the corners and the expected height and widths for the final images.
ImageToolkitTestCase::testSave in modules/simpletest/tests/image.test
Test the image_save() function.

Code

includes/image.inc, line 370

<?php
function image_save(stdClass $image, $destination = NULL) {
  if (empty($destination)) {
    $destination = $image->source;
  }
  if ($return = image_toolkit_invoke('save', $image, array($destination))) {
    // Clear the cached file size and refresh the image information.
    clearstatcache();
    $image->info = image_get_info($destination);

    if (drupal_chmod($destination)) {
      return $return;
    }
  }
  return FALSE;
}
?>

Kommentare

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen

Kommentar hinzufügen

Der Inhalt dieses Feldes wird nicht öffentlich zugänglich angezeigt.
  • Internet- und E-Mail-Adressen werden automatisch umgewandelt.
  • Zulässige HTML-Tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Zeilen und Absätze werden automatisch erzeugt.

Weitere Informationen über Formatierungsoptionen