function imce_image_info in IMCE 6
Check if the file is an image and return info.
4 calls to imce_image_info()
- imce_resize_image in inc/
page.inc - Resize an image in the file list. Also used for thumbnail creation.
- imce_scan_directory in inc/
page.inc - Scan directory and return file list, subdirectories, and total size.
- imce_upload_submit in inc/
page.inc - Submit upload form.
- imce_validate_all in inc/
page.inc - Validate uploaded file.
File
- inc/
page.inc, line 628
Code
function imce_image_info($file) {
if (is_file($file) && ($dot = strrpos($file, '.')) && in_array(strtolower(substr($file, $dot + 1)), array(
'jpg',
'jpeg',
'gif',
'png',
)) && ($info = @getimagesize($file)) && in_array($info[2], array(
IMAGETYPE_JPEG,
IMAGETYPE_GIF,
IMAGETYPE_PNG,
))) {
return array(
'width' => $info[0],
'height' => $info[1],
'type' => $info[2],
'mime' => $info['mime'],
);
}
return FALSE;
}