diff options
| author | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-08-31 18:04:21 +0300 |
|---|---|---|
| committer | mamouneyya <mamoun.diraneyya@gmail.com> | 2010-08-31 18:04:21 +0300 |
| commit | 0b6664e8f9d19df025739bc4a0cf1821563d6b3d (patch) | |
| tree | 5b1de2331d4a9d0eb8d97bbb74be6d794d6260a1 /modules/gallery/helpers/photo.php | |
| parent | 0a128bab0a788288c5291491a68bd1c9ab432825 (diff) | |
| parent | 23d59dec7240dfa4bffe9d88f46a848e76ce0134 (diff) | |
Merge remote branch 'gallery3/master'
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); + } } |
