From 36c7b268e1efcbd4344fe83043a5ef9878fb45c0 Mon Sep 17 00:00:00 2001 From: Ryan Cramer Date: Thu, 13 Oct 2016 10:14:47 -0400 Subject: [PATCH] Another adjustment to PageImage per issue #31 --- wire/core/ImageSizer.php | 2 ++ wire/core/Pageimage.php | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/wire/core/ImageSizer.php b/wire/core/ImageSizer.php index 01e53568..9b7e423a 100755 --- a/wire/core/ImageSizer.php +++ b/wire/core/ImageSizer.php @@ -13,6 +13,8 @@ * * Copyright (C) 2016 by Horst Nogajski and Ryan Cramer * This file licensed under Mozilla Public License v2.0 http://mozilla.org/MPL/2.0/ + * + * @method bool resize($targetWidth, $targetHeight = 0) * */ class ImageSizer extends Wire { diff --git a/wire/core/Pageimage.php b/wire/core/Pageimage.php index 2e2c0a5e..687b64ac 100644 --- a/wire/core/Pageimage.php +++ b/wire/core/Pageimage.php @@ -686,6 +686,7 @@ class Pageimage extends Pagefile { // return hidpi width intended: scale omitted or provided in $width argument $scale = $width; if(!$scale || $scale < 0 || $scale > 1) $scale = 0.5; + if(is_string($options) && $options === "100%") return $options; $width = is_array($options) ? 0 : (int) $options; if($width < 1) $width = $this->width(); if($width === "100%") return $width; @@ -1119,8 +1120,8 @@ class Pageimage extends Pagefile { return false; } - $info['hidpiWidth'] = $this->hidpiWidth(null, $info['width']); - $info['hidpiHeight'] = $this->hidpiWidth(null, $info['height']); + $info['hidpiWidth'] = $this->hidpiWidth(0, $info['width']); + $info['hidpiHeight'] = $this->hidpiWidth(0, $info['height']); if(empty($info['crop'])) { // attempt to extract crop info from suffix