From e396c255f5b11c14d4f5330bc3f8b4ec1567ab2a Mon Sep 17 00:00:00 2001 From: Lee Rowlands Date: Mon, 14 Jun 2021 17:08:47 +1000 Subject: [PATCH] Issue #3215198 by phma: Thumbnail updates read width and height from source image on save even if queued (cherry picked from commit 9edbbe5a04a9c2671db96a113fa366c00aa669b5) --- core/modules/media/src/Plugin/media/Source/Image.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/modules/media/src/Plugin/media/Source/Image.php b/core/modules/media/src/Plugin/media/Source/Image.php index be37177f2dc..4b6d48bd01c 100644 --- a/core/modules/media/src/Plugin/media/Source/Image.php +++ b/core/modules/media/src/Plugin/media/Source/Image.php @@ -130,12 +130,13 @@ class Image extends File { } $uri = $file->getFileUri(); - $image = $this->imageFactory->get($uri); switch ($name) { case static::METADATA_ATTRIBUTE_WIDTH: + $image = $this->imageFactory->get($uri); return $image->getWidth() ?: NULL; case static::METADATA_ATTRIBUTE_HEIGHT: + $image = $this->imageFactory->get($uri); return $image->getHeight() ?: NULL; case 'thumbnail_uri':