From 3e8732947515d106d27a3ac0a521873044f77f99 Mon Sep 17 00:00:00 2001 From: "vincent@cubedesigners.com" Date: Mon, 6 May 2019 18:29:40 +0000 Subject: [PATCH] #2691 --- inc/ws/Metier/class.ws.document.php | 2 +- inc/ws/Util/class.ws.pdf.convert.php | 2 +- .../html5/master/class.ws.html5.compiler.php | 76 +++++++++---------- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/inc/ws/Metier/class.ws.document.php b/inc/ws/Metier/class.ws.document.php index 7ec94035e..d694452ee 100644 --- a/inc/ws/Metier/class.ws.document.php +++ b/inc/ws/Metier/class.ws.document.php @@ -429,7 +429,7 @@ class wsDocument extends cubeMetier public function makeMiniShot($page) { - $this->makeShotFixedWidth($page, 'p', 100, 90, 4, 'PNM'); + $this->makeShotFixedWidth($page, 'p', 500, 65, 4, 'PNM'); } public function makeShotFixedWidth($page, $prefix = '', $w = 100, $quality = 90, $antialiasing = 4, $method = 'PNM') diff --git a/inc/ws/Util/class.ws.pdf.convert.php b/inc/ws/Util/class.ws.pdf.convert.php index 387c2e2b7..1c22e933c 100644 --- a/inc/ws/Util/class.ws.pdf.convert.php +++ b/inc/ws/Util/class.ws.pdf.convert.php @@ -9,7 +9,7 @@ class wsPDFConvert { public static function makeMiniShot($in, $out, $page) { - self::makeShotFixedWidth($in, $out, $page, 'p', 100, 90, 4, 'PNM'); + self::makeShotFixedWidth($in, $out, $page, 'p', 500, 65, 4, 'PNM'); } public static function makeShotFixedWidth($in, $out, $page, $prefix = '', $w = 100, $quality = 90, $antialiasing = 4, $method = 'PNM') { diff --git a/inc/ws/Util/html5/master/class.ws.html5.compiler.php b/inc/ws/Util/html5/master/class.ws.html5.compiler.php index 7289ea1cb..2bf0fa154 100644 --- a/inc/ws/Util/html5/master/class.ws.html5.compiler.php +++ b/inc/ws/Util/html5/master/class.ws.html5.compiler.php @@ -1643,47 +1643,47 @@ class wsHTML5Compiler } - $this->makeThumbSprites($thumbs); + //$this->makeThumbSprites($thumbs); $this->log('Made thumbnails'); } - public function makeThumbSprites(array $thumbs) - { - $cols = 10; - $rows = 10; - $perSprite = $cols * $rows; - $k = 0; - $res = ''; - $pages = count($thumbs); - - $hash = ''; - for ($i = 1; $i <= $pages; $i += $perSprite) { - $num = min(1 + $pages - $i, $perSprite); - $srows = ceil($num / $cols); - $files = array(); - $mtime = 0; - for ($j = 0; $j < $perSprite; $j++) { - $p = $i + $j; - if ($p > $pages) { - break; - } - $files[] = $thumbs[$p]; - $hash .= $thumbs[$p] . '--' . filemtime($thumbs[$p]); - } - - $cache = WS_CACHE . '/thumbsprites/' . hash('sha256', $hash) . '.jpg'; - $dest = 'data/thumbnails/s' . $k . '.jpg'; - if (!file_exists($cache)) { - $ratio = $this->width / $this->height; - $thumbh = round(100 / $ratio); - $cmd = 'montage ' . implode(' ', $files) . ' -geometry 100x' . $thumbh . '!+0+0 -background transparent -tile ' . $cols . 'x' . $srows . ' ' . $cache; - $res .= `$cmd`; - } - $this->vdir->copy($cache, $dest); - $k++; - } - return $res; - } +// public function makeThumbSprites(array $thumbs) +// { +// $cols = 10; +// $rows = 10; +// $perSprite = $cols * $rows; +// $k = 0; +// $res = ''; +// $pages = count($thumbs); +// +// $hash = ''; +// for ($i = 1; $i <= $pages; $i += $perSprite) { +// $num = min(1 + $pages - $i, $perSprite); +// $srows = ceil($num / $cols); +// $files = array(); +// $mtime = 0; +// for ($j = 0; $j < $perSprite; $j++) { +// $p = $i + $j; +// if ($p > $pages) { +// break; +// } +// $files[] = $thumbs[$p]; +// $hash .= $thumbs[$p] . '--' . filemtime($thumbs[$p]); +// } +// +// $cache = WS_CACHE . '/thumbsprites/' . hash('sha256', $hash) . '.jpg'; +// $dest = 'data/thumbnails/s' . $k . '.jpg'; +// if (!file_exists($cache)) { +// $ratio = $this->width / $this->height; +// $thumbh = round(100 / $ratio); +// $cmd = 'montage ' . implode(' ', $files) . ' -geometry 100x' . $thumbh . '!+0+0 -background transparent -tile ' . $cols . 'x' . $srows . ' ' . $cache; +// $res .= `$cmd`; +// } +// $this->vdir->copy($cache, $dest); +// $k++; +// } +// return $res; +// } protected function _makeCover($orig) { -- 2.39.5