From 1927dd00e42062a98855d121ec8427b25d74d015 Mon Sep 17 00:00:00 2001 From: shadlaws Date: Sun, 20 Jan 2013 08:34:12 +0100 Subject: #1949 - Fix album thumb mime types given by data_rest and file_proxy Correct result: always "image/jpeg" Old data_rest result: mime of cover item Old file_proxy result: mime of album item (null) --- modules/gallery/controllers/file_proxy.php | 4 ++-- modules/gallery/helpers/data_rest.php | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'modules') diff --git a/modules/gallery/controllers/file_proxy.php b/modules/gallery/controllers/file_proxy.php index 9af58c0c..b2120455 100644 --- a/modules/gallery/controllers/file_proxy.php +++ b/modules/gallery/controllers/file_proxy.php @@ -126,8 +126,8 @@ class File_Proxy_Controller extends Controller { expires::set(2592000, $item->updated); // 30 days - // Dump out the image. If the item is a movie, then its thumbnail will be a JPG. - if ($item->is_movie() && $type != "albums") { + // Dump out the image. If the item is a movie or album, then its thumbnail will be a JPG. + if (($item->is_movie() || $item->is_album()) && $type == "thumbs") { header("Content-Type: image/jpeg"); } else { header("Content-Type: $item->mime_type"); diff --git a/modules/gallery/helpers/data_rest.php b/modules/gallery/helpers/data_rest.php index abd4638e..ef4f17e7 100644 --- a/modules/gallery/helpers/data_rest.php +++ b/modules/gallery/helpers/data_rest.php @@ -57,13 +57,11 @@ class data_rest_Core { return; } - // Dump out the image. If the item is a movie, then its thumbnail will be a JPG. - if ($item->is_movie() && $p->size == "thumb") { + // Dump out the image. If the item is a movie or album, then its thumbnail will be a JPG. + if (($item->is_movie() || $item->is_album()) && $p->size == "thumb") { header("Content-Type: image/jpeg"); - } else if ($item->is_album()) { - header("Content-Type: " . $item->album_cover()->mime_type); } else { - header("Content-Type: {$item->mime_type}"); + header("Content-Type: $item->mime_type"); } Kohana::close_buffers(false); -- cgit v1.2.3