Add several ways to handle thumbnails. re #5
This commit is contained in:
parent
b82bf8c19f
commit
13b16163d3
5
book.php
5
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;
|
||||
|
|
|
@ -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
|
||||
|
|
8
data.php
8
data.php
|
@ -131,12 +131,20 @@ class Data extends Base {
|
|||
$height = $config['cops_html_thumbnail_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));
|
||||
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
|
||||
{
|
||||
return new Link (str_replace('%2F','/',rawurlencode ($book->path."/".$filename)), $mime, $rel, $title);
|
||||
|
|
BIN
images/bookcover.png
Normal file
BIN
images/bookcover.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3 KiB |
Loading…
Reference in a new issue