From 29fc82c364e2e90330d9858528e50d785e5e66bd Mon Sep 17 00:00:00 2001 From: Bart Visscher Date: Mon, 13 Feb 2012 23:35:33 +0100 Subject: Send gallery album thumbnail with OC_Response::sendFile --- apps/gallery/ajax/galleryOp.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php index 9273de2599d..5ac6d295108 100644 --- a/apps/gallery/ajax/galleryOp.php +++ b/apps/gallery/ajax/galleryOp.php @@ -41,9 +41,9 @@ function handleRemove($name) { function handleGetThumbnails($albumname) { OC_Response::enableCaching(3600 * 24); // 24 hour - $photo = new OC_Image(); - $photo->loadFromFile(OC::$CONFIG_DATADIRECTORY.'/../gallery/'.$albumname.'.png'); - $photo->show(); + $thumbnail = OC::$CONFIG_DATADIRECTORY.'/../gallery/'.$albumname.'.png'; + header('Content-Type: '.OC_Image::getMimeTypeForFile($thumbnail)); + OC_Response::sendFile($thumbnail); } function handleGalleryScanning() { -- cgit v1.2.3