function image_gd_close in Drupal 6
Same name and namespace in other branches
- 4 includes/image.inc \image_gd_close()
 - 5 includes/image.inc \image_gd_close()
 
GD helper to write an image resource to a destination file.
Parameters
$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.
Return value
Boolean indicating success.
Related topics
3 calls to image_gd_close()
- image_gd_crop in includes/
image.gd.inc  - Crop an image using the GD toolkit.
 - image_gd_resize in includes/
image.gd.inc  - Scale an image to the specified size using GD.
 - image_gd_rotate in includes/
image.gd.inc  - Rotate an image the given number of degrees.
 
File
- includes/
image.gd.inc, line 204  - GD2 toolkit for image manipulation within Drupal.
 
Code
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);
  }
}