You are here

function _image_imageinfo_cache_get_details in Imageinfo Cache 7.3

Get details about an image.

Parameters

object $image: An image object.

Return value

mixed FALSE, if the file could not be found or is not an image. Otherwise, a keyed array containing information about the image:

  • width: Width in pixels.
  • height: Height in pixels.
  • extension: Commonly used file extension for the image.
  • mime_type: MIME type ('image/jpeg', 'image/gif', 'image/png').
  • file_size: Image size in bytes.

See also

image_get_info()

1 call to _image_imageinfo_cache_get_details()
image_imageinfo_cache_get_info in ./imageinfo_cache.toolkit.inc
Get details about an image.

File

./imageinfo_cache.toolkit.inc, line 116
Imageinfo Cache module. Pseudo image toolkit functions.

Code

function _image_imageinfo_cache_get_details($image) {

  // Change toolkit back to the original value.
  $image->toolkit = variable_get('image_toolkit_original', 'gd');
  $details = image_toolkit_invoke('get_info', $image);

  // Change toolkit to the pseudo value again.
  $image->toolkit = variable_get('image_toolkit', 'gd');
  if (isset($details) && is_array($details)) {
    $details['file_size'] = filesize($image->source);
  }
  return $details;
}