You are here

function iek_gd_create_image in Image effect kit 7

Same name and namespace in other branches
  1. 8 iek.module \iek_gd_create_image()

Creates an image from file or URL.

Parameters

string $file: Path to the image.

Return value

object An image identifier representing the image obtained from the given filename.

1 call to iek_gd_create_image()
iek_gd_overlay in ./iek.gd.inc
Add a overlay on an image by using the GD toolkit.

File

./iek.module, line 1389
Primarily Drupal hooks and global API functions to manipulate image styles.

Code

function iek_gd_create_image($file) {
  $data = @getimagesize($file);
  switch ($data['mime']) {
    case 'image/jpeg':
      $image = imagecreatefromjpeg($file);
      break;
    case 'image/gif':
      $image = imagecreatefromgif($file);
      break;
    case 'image/png':
      $image = imagecreatefrompng($file);
      break;
    default:
      $image = NULL;
      break;
  }
  return $image;
}