diff --git a/wire/modules/Inputfield/InputfieldImage/InputfieldImage.module b/wire/modules/Inputfield/InputfieldImage/InputfieldImage.module index ed1bc74c..a23171fb 100755 --- a/wire/modules/Inputfield/InputfieldImage/InputfieldImage.module +++ b/wire/modules/Inputfield/InputfieldImage/InputfieldImage.module @@ -220,7 +220,9 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu $config->scripts->add($thisURL . "PWImageResizer.$jsExt?v={$config->version}-$moduleInfo[version]"); $maxSize = str_replace(',', '.', $this->maxSize); $quality = str_replace(',', '.', (float) ($this->clientQuality / 100)); - $this->wrapAttr('data-resize', "$this->maxWidth;$this->maxHeight;$maxSize;$quality"); + $maxWidth = $this->maxWidth ? (int) $this->maxWidth : 99999; + $maxHeight = $this->maxHeight ? (int) $this->maxHeight : 99999; + $this->wrapAttr('data-resize', "$maxWidth;$maxHeight;$maxSize;$quality"); } $value = $this->val(); @@ -1000,7 +1002,7 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu * }); * ~~~~~ * - * @param Pagefile|Pageimage $pagefile + * @param Pageimage $pagefile * @return array Associative array of ('action_name' => 'Action Label') * */ @@ -1166,7 +1168,7 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu /** * Get variations for the given Pagefile * - * @param Pagefile|Pageimage $pagefile + * @param Pageimage $pagefile * @return array * */ @@ -1177,7 +1179,7 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu /** * Get the image editor URL * - * @param Pagefile|Pageimage $pagefile + * @param Pageimage $pagefile * @param int $pageID * @return string * @@ -1196,7 +1198,7 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu /** * Render the description field input * - * @param Pagefile|Pageimage $pagefile + * @param Pageimage $pagefile * @param string $id * @param int $n * @return string @@ -1355,7 +1357,7 @@ class InputfieldImage extends InputfieldFile implements InputfieldItemList, Inpu * Process input for a given Pageimage * * @param WireInputData $input - * @param Pagefile|Pageimage $pagefile + * @param Pageimage $pagefile * @param int $n * @return bool * diff --git a/wire/modules/Inputfield/InputfieldImage/config.php b/wire/modules/Inputfield/InputfieldImage/config.php index 1dc254d9..1df92cba 100644 --- a/wire/modules/Inputfield/InputfieldImage/config.php +++ b/wire/modules/Inputfield/InputfieldImage/config.php @@ -84,7 +84,7 @@ class InputfieldImageConfiguration extends Wire { $field->attr('name', 'resizeServer'); $field->label = $this->_('How to resize to max dimensions'); $field->description = $this->_('Using client-side resize enables you to reduce the file size and dimensions before uploading.'); - $field->notes = $this->_('When using client-side resize, please specify both max width *and* max height in the fields above, or max megapixels in the field below.'); + $field->notes = $this->_('When using client-side resize, please specify max width and/or max height in the fields above, or max megapixels in the field below.'); $field->icon = 'object-group'; $field->addOption(0, $this->_('Use client-side resize when possible')); $field->addOption(1, $this->_('Use only server-side resize'));