| Versionen | |
|---|---|
| drupal7 | image_gd_load(stdClass $image) |
GD helper function to create an image resource from a file.
see image_load()
$image An image object. The $image->resource value will populated by this call.
TRUE or FALSE, based on success.
modules/
<?php
function image_gd_load(stdClass $image) {
$extension = str_replace('jpg', 'jpeg', $image->info['extension']);
$function = 'imagecreatefrom' . $extension;
return (function_exists($function) && $image->resource = $function($image->source));
}
?>
Kommentare
Kommentar hinzufügen