1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-06 23:06:59 +02:00
This commit is contained in:
Ryan Cramer
2024-12-27 12:44:02 -05:00
parent 86fc754ffb
commit cef47391ee
2 changed files with 9 additions and 7 deletions

View File

@@ -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
*

View File

@@ -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'));