diff --git a/levgal_tpl/LevGal-Item.template.php b/levgal_tpl/LevGal-Item.template.php index 1f05ad7..f7b0188 100644 --- a/levgal_tpl/LevGal-Item.template.php +++ b/levgal_tpl/LevGal-Item.template.php @@ -698,7 +698,7 @@ function template_item_picture() // Maybe we're showing a preview of the thing, or maybe we're just inlining the thing. $using = empty($context['item_display']['urls']['preview']) ? 'raw' : 'preview'; - if (!empty($context['item_display']['needs_lightbox'])) + if (!empty($context['item_display']['needs_lightbox']) && $context['item_details']['mime_type'] !== 'image/tiff') { echo '
@@ -712,6 +712,19 @@ function template_item_picture()
'; } + elseif ($context['item_display']['needs_lightbox'] && $context['item_details']['mime_type'] === 'image/tiff') + { + // Browser tiff support is very spotty so for now we dont want it in glightbox + echo ' +
+ + + +
', + $context['item_details']['description'], ' +
+
'; + } else { // If it's not big enough to need a preview, display the actual GIF in case it has animation. @@ -1112,6 +1125,7 @@ function template_edit_item() lgal_quota: ' . (empty($context['quota_data']) ? '{}' : json_encode($context['quota_data'])) . ', lgal_enable_resize: ' . (empty($context['lgal_enable_resize']) ? 'false' : 'true') . ', maxFiles: 1, + maxThumbnailFilesize: defaults.maxThumbnailFilesize, paramName: defaults.paramName, chunking: defaults.chunking, retryChunks: defaults.retryChunks, @@ -1163,7 +1177,7 @@ function template_edit_item() }); }, accept: function(file, done) { - this.on("thumbnail", function(file) { + this.on("thumbnail", function(file, dataURL) { let result = addFileFilter(file, this.options.lgal_quota, this.options.lgal_enable_resize); if (result !== true) { @@ -1173,6 +1187,13 @@ function template_edit_item() } else { + // This is for tiff files, maybe others, which fail on creating a client side thumbnail + if (typeof dataURL === "object" && dataURL instanceof Event) + { + let dataURL = get_upload_generic_thumbnail(file, this.options.lgal_quota); + file.previewElement.querySelector("img[data-dz-thumbnail]").src = dataURL; + } + done(); } });