diff options
| author | Nathan Kinkade <nkinkade@nkinka.de> | 2010-08-19 23:29:35 +0000 |
|---|---|---|
| committer | Nathan Kinkade <nkinkade@nkinka.de> | 2010-08-19 23:29:35 +0000 |
| commit | 45b6d344b4a5431e7cf11fde5808c63bf7553676 (patch) | |
| tree | 33a5bd2ee0124553c4d35f4152e607296479a551 /modules/gallery/helpers/photo.php | |
| parent | d1475ec40ebda6404baab45b5b2482c651e657f9 (diff) | |
| parent | 21a0f832b66eaba902b09e2a88ece52c76e4a0c3 (diff) | |
Merge branch 'master' of git://github.com/gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/photo.php')
| -rw-r--r-- | modules/gallery/helpers/photo.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/modules/gallery/helpers/photo.php b/modules/gallery/helpers/photo.php index 73cd60c0..a38b4fb2 100644 --- a/modules/gallery/helpers/photo.php +++ b/modules/gallery/helpers/photo.php @@ -77,4 +77,16 @@ class photo_Core { } return sprintf($format, $new_width, $new_height); } + + /** + * Return the width, height, mime_type and extension of the given image file. + */ + static function get_file_metadata($file_path) { + $image_info = getimagesize($file_path); + $width = $image_info[0]; + $height = $image_info[1]; + $mime_type = $image_info["mime"]; + $extension = image_type_to_extension($image_info[2], false); + return array($width, $height, $mime_type, $extension); + } } |
