diff options
author | Tim Almdal <tnalmdal@shaw.ca> | 2010-08-16 21:54:40 -0700 |
---|---|---|
committer | Tim Almdal <tnalmdal@shaw.ca> | 2010-08-16 21:54:40 -0700 |
commit | de91d0fe4f5764eae7902a4790c57cac635aa0be (patch) | |
tree | fd4996f0c939187c6908689596400bd5e8814c0b /modules/gallery/helpers/data_rest.php | |
parent | 9592f2f2e6dfff7f5a500b29511ba3bd23a0fa15 (diff) | |
parent | 8c2ed0d681364837ab51b35d7aeb895b8adfa470 (diff) |
Merge branch 'master' of git@github.com:gallery/gallery3
Diffstat (limited to 'modules/gallery/helpers/data_rest.php')
-rw-r--r-- | modules/gallery/helpers/data_rest.php | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/modules/gallery/helpers/data_rest.php b/modules/gallery/helpers/data_rest.php index 3cd2f59a..98c98894 100644 --- a/modules/gallery/helpers/data_rest.php +++ b/modules/gallery/helpers/data_rest.php @@ -57,9 +57,17 @@ class data_rest_Core { // We don't need to save the session for this request Session::instance()->abort_save(); + if ($item->is_album() && !$item->album_cover_item_id) { + // No thumbnail. Return nothing. + // @todo: what should we do here? + 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") { 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}"); } |