Fixed error on thumbnail image creation

This commit is contained in:
Matias Griese 2022-01-28 05:10:18 +02:00
parent b9db2f3322
commit 7666651324
3 changed files with 8 additions and 4 deletions

View File

@ -7,6 +7,8 @@
2. [](#improved)
* Improved `Filesystem::basename()` and `Filesystem::pathinfo()` to be unicode-safe
* Made path handling unicode-safe, use new `Utils::basename()` and `Utils::pathinfo()` everywhere
3. [](#bugfix)
* Fixed error on thumbnail image creation
* Fixed MimeType for `gzip` (`application/x-gzip`)
# v1.7.28

View File

@ -574,11 +574,12 @@ trait MediaObjectTrait
foreach ($types as $type) {
$thumb = $this->get("thumbnails.{$type}", false);
if ($thumb) {
$thumb = $thumb instanceof ThumbnailImageMedium ? $thumb : $this->createThumbnail($thumb);
$thumb->parent = $this;
$this->_thumbnail = $thumb;
$image = $thumb instanceof ThumbnailImageMedium ? $thumb : $this->createThumbnail($thumb);
if($image) {
$image->parent = $this;
$this->_thumbnail = $image;
}
break;
}
}

View File

@ -106,6 +106,7 @@ class Medium extends Data implements RenderableInterface, MediaFileInterface
/**
* @param string $thumb
* @return Medium|null
*/
protected function createThumbnail($thumb)
{