| Versionen | |
|---|---|
| drupal7 | image_load($file, $toolkit = FALSE) |
Load an image file and return an image object.
Any changes to the file are not saved until image_save() is called.
see image_save()
$file Path to an image file.
$toolkit An optional, image toolkit name to override the default.
An image object or FALSE if there was a problem loading the file. The image object has the following properties:
Image tookits may add additional properties. The caller is advised not to monkey about with them.
image_get_available_toolkits()
includes/
<?php
function image_load($file, $toolkit = FALSE) {
if (!$toolkit) {
$toolkit = image_get_toolkit();
}
if ($toolkit) {
$image = new stdClass();
$image->source = $file;
$image->info = image_get_info($file);
$image->toolkit = $toolkit;
if (image_toolkit_invoke('load', $image)) {
return $image;
}
}
return FALSE;
}
?>
Kommentare
Kommentar hinzufügen