diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-02-13 23:35:33 +0100 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-02-13 23:35:37 +0100 |
commit | 29fc82c364e2e90330d9858528e50d785e5e66bd (patch) | |
tree | c5b50a3b632ee5186cdaca10113a6438f244bfae /lib/image.php | |
parent | 594dcf13f2d311ba2161e33effe6e297939e3595 (diff) | |
download | nextcloud-server-29fc82c364e2e90330d9858528e50d785e5e66bd.tar.gz nextcloud-server-29fc82c364e2e90330d9858528e50d785e5e66bd.zip |
Send gallery album thumbnail with OC_Response::sendFile
Diffstat (limited to 'lib/image.php')
-rw-r--r-- | lib/image.php | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/image.php b/lib/image.php index df8f76352a0..b1d3a14f415 100644 --- a/lib/image.php +++ b/lib/image.php @@ -48,6 +48,11 @@ class OC_Image { protected $imagetype = IMAGETYPE_PNG; // Default to png if file type isn't evident. protected $filepath = null; + static public function getMimeTypeForFile($filepath) { + $imagetype = exif_imagetype($filepath); + return $imagetype ? image_type_to_mime_type($imagetype) : ''; + } + /** * @brief Constructor. * @param $imageref The path to a local file, a base64 encoded string or a resource created by an imagecreate* function. |