From 93d57490b66b351c053bd85f62135ca14b7a1c88 Mon Sep 17 00:00:00 2001 From: profiteroles Date: Thu, 13 Jun 2019 06:24:11 -0700 Subject: [PATCH] Tweaks --- helper.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/helper.php b/helper.php index ead6e4f..fdee972 100755 --- a/helper.php +++ b/helper.php @@ -16,6 +16,8 @@ $pathname = $argv[3]; $bpath = $argv[4]; $mytime = $argv[5]; +$ext = pathinfo($pathname, PATHINFO_EXTENSION); + $tfile = "/tmp/Yuba/".$mytime."/".$fid.".png"; $shellpath = escapeshellarg($pathname); @@ -28,11 +30,11 @@ switch ($mode) { case "icons": - if (@!$dbp->query("SELECT EXISTS(SELECT 1 FROM icons WHERE fid='".$fid."')")->fetch()[0]) { + if (!in_array($ext, $p['i_skip']) && @!$dbp->query("SELECT EXISTS(SELECT 1 FROM icons WHERE fid='".$fid."')")->fetch()[0]) { $stmt = $dbp->prepare("INSERT INTO icons VALUES (:fid, :hash, :created, :relative_path, :tool)"); - $cmd = $bin_qltool." di ".$shellpath." ".$p['thumb_size']." ".$p['thumb_size']." | base64 --decode > ".$tfile; + $cmd = $bin_qltool." di ".$shellpath." ".$p['icon_size']." ".$p['icon_size']." | base64 --decode > ".$tfile; shell_exec($cmd); $stmt->BindValue(":fid",$fid); @@ -52,10 +54,17 @@ switch ($mode) { $stmt->BindValue(":tool","qltool"); } } + $stmt->execute(); } + break; + + case: "thumbs": + + + break; }