| Versionen | |
|---|---|
| drupal6 | image_gd_close($res, $destination, $extension) |
GD helper to write an image resource to a destination file.
$res An image resource created with image_gd_open().
$destination A string file path where the iamge should be saved.
$extension A string containing one of the following extensions: gif, jpg, jpeg, png.
Boolean indicating success.
includes/
<?php
function image_gd_close($res, $destination, $extension) {
$extension = str_replace('jpg', 'jpeg', $extension);
$close_func = 'image' . $extension;
if (!function_exists($close_func)) {
return FALSE;
}
if ($extension == 'jpeg') {
return $close_func($res, $destination, variable_get('image_jpeg_quality', 75));
}
else {
return $close_func($res, $destination);
}
}
?>
Kommentare
Kommentar hinzufügen