Get details about an image. Image toolkit callback: Retrieves details about an image.
$image: An image object.
FALSE, if the file could not be found or is not an image. Otherwise, a keyed array containing information about the image:
function image_gd_get_info(stdClass $image) {
$details = FALSE;
$data = getimagesize($image->source);
if (isset($data) && is_array($data)) {
$extensions = array(
'1' => 'gif',
'2' => 'jpg',
'3' => 'png',
);
$extension = isset($extensions[$data[2]]) ? $extensions[$data[2]] : '';
$details = array(
'width' => $data[0],
'height' => $data[1],
'extension' => $extension,
'mime_type' => $data['mime'],
);
}
return $details;
}