public function generateImage()
{
- $maxzoom = ((int)$this->to !== 0) ? $this->to : $this->maxzoom_default; // Max zoom level might not always be set in the link editor
- $maxzoom = min($maxzoom, 4.166666667);
+ $maxzoom = $this->getZoomAttributes()['maxzoom']; // Max zoom level might not always be set in the link editor
+ $maxzoom = max(2, min($maxzoom, 4.166666667));
+ if(!$maxzoom){
+ $maxzoom=2;
+ }
// TODO: Consider generating higher-res images (eg. 2x) for HiDPI screens. Maybe some extra optimisations can be done on the larger images...
class zoomProductLink extends zoomLink
{
+ protected $maxzoom_default = 2.5;
+
public function __construct($id, $init, &$compiler)
{
$init['group'] = $init['to'];
{
$url = isset($this->compiler->config->product_zoom_references[$this->to]) ? $this->compiler->config->product_zoom_references[$this->to] : '';
- $res = array_merge(parent::getZoomAttributes(),
- ['maxzoom' => $this->maxzoom_default, 'ref' => $this->to]
- );
+ $res = parent::getZoomAttributes();
+ $res['maxzoom'] = $this->maxzoom_default;
+ $res['ref'] = $this->to;
if ($url) {
$res['shareurl'] = $url[0];
$n = count($url);
return $res;
}
+
}