diff --git a/book.php b/book.php index 346e1b0..9c34cbc 100644 --- a/book.php +++ b/book.php @@ -632,6 +632,11 @@ function getJson ($complete = false) { "use_fancyapps" => $config ["cops_use_fancyapps"], "max_item_per_page" => $config['cops_max_item_per_page'], "html_tag_filter" => $config['cops_html_tag_filter'])); + if ($config['cops_thumbnail_handling'] == "1") { + $out ["const"]["url"]["thumbnailUrl"] = $out ["const"]["url"]["coverUrl"]; + } else if (!empty ($config['cops_thumbnail_handling'])) { + $out ["const"]["url"]["thumbnailUrl"] = $config['cops_thumbnail_handling']; + } } $out ["containsBook"] = 0; diff --git a/config_default.php b/config_default.php index ff36d3e..b56f6a1 100644 --- a/config_default.php +++ b/config_default.php @@ -202,9 +202,9 @@ * This configuration item allow to customize how thumbnail will be generated * "" : Generate thumbnail (CPU hungry) * "1" : always send the full size image (Network hungry) - * any url : Send a constant image as the thumbnail (you can try "images/bookcover.svg") + * any url : Send a constant image as the thumbnail (you can try "images/bookcover.png") */ - $config['cops_thumbnail_handling'] = "images/bookcover.svg"; + $config['cops_thumbnail_handling'] = ""; /* * Contains a list of user agent for browsers not compatible with client side rendering diff --git a/data.php b/data.php index 2c2c019..4866d45 100644 --- a/data.php +++ b/data.php @@ -131,11 +131,19 @@ class Data extends Base { $height = $config['cops_html_thumbnail_height']; } } - $urlParam = addURLParameter($urlParam, "height", $height); + if ($config['cops_thumbnail_handling'] != "1") { + $urlParam = addURLParameter($urlParam, "height", $height); + } } $urlParam = addURLParameter($urlParam, "id", $book->id); if (!is_null (GetUrlParam (DB))) $urlParam = addURLParameter ($urlParam, DB, GetUrlParam (DB)); - return new Link ("fetch.php?" . $urlParam, $mime, $rel, $title); + if ($config['cops_thumbnail_handling'] != "1" && + !empty ($config['cops_thumbnail_handling']) && + $rel == Link::OPDS_THUMBNAIL_TYPE) { + return new Link ($config['cops_thumbnail_handling'], $mime, $rel, $title); + } else { + return new Link ("fetch.php?" . $urlParam, $mime, $rel, $title); + } } else { diff --git a/images/bookcover.png b/images/bookcover.png new file mode 100644 index 0000000..6c3c8c7 Binary files /dev/null and b/images/bookcover.png differ