summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-07-31 09:57:27 +0000
committerDries Buytaert <dries@buytaert.net>2005-07-31 09:57:27 +0000
commit9e6373820a5205f00d5a350009d4887f85ada88a (patch)
tree8e8dfc8b2d59c12b87a96cbfbc21ad8cb5d20442
parent6fdb939d5581841d248c124578514303225265d0 (diff)
downloadbrdo-9e6373820a5205f00d5a350009d4887f85ada88a.tar.gz
brdo-9e6373820a5205f00d5a350009d4887f85ada88a.tar.bz2
- Patch #27431 by Cvbge: add file size infomation to image_get_info()
-rw-r--r--includes/image.inc3
1 files changed, 3 insertions, 0 deletions
diff --git a/includes/image.inc b/includes/image.inc
index 171dc75e4..7d74d0374 100644
--- a/includes/image.inc
+++ b/includes/image.inc
@@ -78,6 +78,7 @@ function image_toolkit_invoke($method, $params = array()) {
* 'height': image's height in pixels
* 'extension': commonly used extension for the image
* 'mime_type': image's MIME type ('image/jpeg', 'image/gif', etc.)
+ * 'file_size': image's physical size (in bytes)
*/
function image_get_info($file) {
if (!is_file($file)) {
@@ -86,6 +87,7 @@ function image_get_info($file) {
$details = false;
$data = @getimagesize($file);
+ $file_size = @filesize($file);
if (is_array($data)) {
$extensions = array('1' => 'gif', '2' => 'jpg', '3' => 'png');
@@ -93,6 +95,7 @@ function image_get_info($file) {
$details = array('width' => $data[0],
'height' => $data[1],
'extension' => $extension,
+ 'file_size' => $file_size,
'mime_type' => $data['mime']);
}