$cache = WS_CACHE . '/thumbsprites/' . hash('sha256', $hash) . '.jpg';
$dest = $this->vdir . '/data/thumbnails/s' . $k . '.jpg';
if (!file_exists($cache)) {
- $cmd = 'montage ' . implode(' ', $files) . ' -geometry 100x+0+0 -background transparent -tile ' . $cols . 'x' . $srows . ' ' . $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`;
}
copy($cache, $dest);
- $res .= `$cmd`;
$k++;
}
return $res;