| Versionen | |
|---|---|
| drupal7 | image_save(stdClass $image, $destination = NULL) |
Close the image and save the changes to a file.
see image_load()
$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.
TRUE or FALSE, based on success.
includes/
<?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