summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/helpers/data_rest.php8
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}");
}