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')
class wsPDFConvert {\r
\r
public static function makeMiniShot($in, $out, $page) {\r
- self::makeShotFixedWidth($in, $out, $page, 'p', 100, 90, 4, 'PNM');\r
+ self::makeShotFixedWidth($in, $out, $page, 'p', 500, 65, 4, 'PNM');\r
}\r
\r
public static function makeShotFixedWidth($in, $out, $page, $prefix = '', $w = 100, $quality = 90, $antialiasing = 4, $method = 'PNM') {\r
}
- $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)
{