Merge branch 'develop' of github.com:getgrav/grav into feature/api

 Conflicts:
	CHANGELOG.md
	composer.lock
This commit is contained in:
Matias Griese 2022-05-20 16:41:30 +03:00
commit 89709a7190
3 changed files with 17 additions and 6 deletions

View File

@ -5,6 +5,13 @@
* Added support for `multipart/form-data` content type in PUT and PATCH requests
* Added support for flex object relationships
# v1.7.34
## mm/dd/2022
1. [](#bugfix)
* Regression: Fixed saving page with a new language causing cache corruption [getgrav/grav-plugin-admin#2282](https://github.com/getgrav/grav-plugin-admin/issues/2282)
* Fixed a potential fatal error when using watermark in images
# v1.7.33
## 04/25/2022

View File

@ -138,6 +138,10 @@ trait CompiledFile
$class = get_class($this);
$size = filesize($filename);
// Reload data from the filesystem. This ensures that we always cache the correct data (see issue #2282).
$this->raw = $this->content = null;
$data = (array)$this->decode($this->raw());
// Decode data into compiled array.
$cache = [
'@class' => $class,

View File

@ -361,8 +361,8 @@ class ImageMedium extends Medium implements ImageMediaInterface, ImageManipulate
// Scaling operations
$scale = ($scale ?? $config->get('system.images.watermark.scale', 100)) / 100;
$wwidth = $this->get('width') * $scale;
$wheight = $this->get('height') * $scale;
$wwidth = (int)$this->get('width') * $scale;
$wheight = (int)$this->get('height') * $scale;
$watermark->resize($wwidth, $wheight);
// Position operations
@ -377,11 +377,11 @@ class ImageMedium extends Medium implements ImageMediaInterface, ImageManipulate
break;
case 'bottom':
$positionY = $this->get('height')-$wheight;
$positionY = (int)$this->get('height')-$wheight;
break;
case 'center':
$positionY = ($this->get('height')/2) - ($wheight/2);
$positionY = ((int)$this->get('height')/2) - ($wheight/2);
break;
}
@ -392,11 +392,11 @@ class ImageMedium extends Medium implements ImageMediaInterface, ImageManipulate
break;
case 'right':
$positionX = $this->get('width')-$wwidth;
$positionX = (int)$this->get('width')-$wwidth;
break;
case 'center':
$positionX = ($this->get('width')/2) - ($wwidth/2);
$positionX = ((int)$this->get('width')/2) - ($wwidth/2);
break;
}