image_gd_open

Versions
4.6 – 6
image_gd_open($file, $extension)

GD helper function to create an image resource from a file.

▾ 3 functions call image_gd_open()

image_gd_crop in includes/image.inc
Crop an image using the GD toolkit.
image_gd_resize in includes/image.inc
Scale an image to the specified size using GD.
image_gd_rotate in includes/image.inc
Rotate an image the given number of degrees.

Code

includes/image.inc, line 277

<?php
function image_gd_open($file, $extension) {
  $extension = str_replace('jpg', 'jpeg', $extension);
  $open_func = 'imageCreateFrom'. $extension;
  if (!function_exists($open_func)) {
    return false;
  }
  return $open_func($file);
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.