summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2017-03-25 20:48:42 -0300
committerSilvio Rhatto <rhatto@riseup.net>2017-03-25 20:48:42 -0300
commit153bf795eb756fdd92583ccd4d2485640085015d (patch)
treeccbc2ade152fe35cb65cb3582b6ebfc17f1166bf
parente5ebe4e5519c48b225b03b5532eb8c5643b7afea (diff)
downloadsemanticscuttle-153bf795eb756fdd92583ccd4d2485640085015d.tar.gz
semanticscuttle-153bf795eb756fdd92583ccd4d2485640085015d.tar.bz2
Cache: PNG support
-rw-r--r--data/templates/default/bookmarks.tpl.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/data/templates/default/bookmarks.tpl.php b/data/templates/default/bookmarks.tpl.php
index 19ab6a8..4f22e91 100644
--- a/data/templates/default/bookmarks.tpl.php
+++ b/data/templates/default/bookmarks.tpl.php
@@ -345,6 +345,7 @@ if ($currenttag!= '') {
$assetHash = substr($assetHash, 0, 2) . '/' . substr($assetHash, 2, 2) . '/' . $assetHash;
$assetLink = $GLOBALS['cacheUrl'] . '/' . $assetHash;
$assetPdf = $assetLink .'/screenshot.pdf';
+ $assetPng = $assetLink .'/screenshot.png';
// Check if the link exists
if ($fp = curl_init($assetLink)) {
@@ -369,6 +370,20 @@ if ($currenttag!= '') {
curl_close($fp);
}
+
+ // Check if PNG is available
+ if ($fp = curl_init($assetPng)) {
+ curl_setopt($fp, CURLOPT_NOBODY, true);
+ curl_exec($fp);
+
+ $retcode = curl_getinfo($fp, CURLINFO_HTTP_CODE);
+
+ if ($retcode != 404) {
+ $cacheLink .= " | <a href=\"$assetPng\">PNG</a>";
+ }
+
+ curl_close($fp);
+ }
}
curl_close($fp);