diff --git a/src/_h5ai/private/php/ext/class-thumb.php b/src/_h5ai/private/php/ext/class-thumb.php index d52d3e85e..03b3df1ec 100644 --- a/src/_h5ai/private/php/ext/class-thumb.php +++ b/src/_h5ai/private/php/ext/class-thumb.php @@ -29,8 +29,12 @@ public function thumb($type, $source_href, $width, $height) { return null; } - $capture_path = $source_path; - if ($type === 'img') { + $capture_path = false; + $fileparts = pathinfo($source_path); + $custom_path = $fileparts['dirname'].'/.thumb/'.$fileparts['filename'].'.jpg'; + if (file_exists($custom_path)) { + $capture_path = $custom_path; + } elseif ($type === 'img') { $capture_path = $source_path; } elseif ($type === 'mov') { if ($this->setup->get('HAS_CMD_AVCONV')) { @@ -46,7 +50,7 @@ public function thumb($type, $source_href, $width, $height) { } } - return $this->thumb_href($capture_path, $width, $height); + return $capture_path ? $this->thumb_href($capture_path, $width, $height) : null; } private function thumb_href($source_path, $width, $height) { diff --git a/src/_h5ai/public/js/lib/ext/thumbnails.js b/src/_h5ai/public/js/lib/ext/thumbnails.js index d71898cc2..1c7d2c558 100644 --- a/src/_h5ai/public/js/lib/ext/thumbnails.js +++ b/src/_h5ai/public/js/lib/ext/thumbnails.js @@ -25,8 +25,6 @@ const queueItem = (queue, item) => { type = 'mov'; } else if (includes(settings.doc, item.type)) { type = 'doc'; - } else { - return; } if (item.thumbSquare) {