| Versionen | |
|---|---|
| drupal6 | image_gd_open($file, $extension) |
GD helper function to create an image resource from a file.
$file A string file path where the iamge should be saved.
$extension A string containing one of the following extensions: gif, jpg, jpeg, png.
An image resource, or FALSE on error.
includes/
<?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);
}
?>
Kommentare
Kommentar hinzufügen