Use constant from SettingsController in image renderer
[MAILPOET-5788]
This commit is contained in:
committed by
Rostislav Wolný
parent
932f47b763
commit
1030d521c0
@@ -44,7 +44,7 @@ class Image implements BlockRenderer {
|
||||
*/
|
||||
private function addImageSizeWhenMissing(array $parsedBlock, string $imageUrl): array {
|
||||
if (!isset($parsedBlock['attrs']['width'])) {
|
||||
$maxWidth = $parsedBlock['email_attrs']['width'] ?? '660px';
|
||||
$maxWidth = $parsedBlock['email_attrs']['width'] ?? SettingsController::EMAIL_WIDTH;
|
||||
$imageSize = wp_getimagesize($imageUrl);
|
||||
$imageSize = $imageSize ? "{$imageSize[0]}px" : $maxWidth;
|
||||
$parsedBlock['attrs']['width'] = ($imageSize > $maxWidth) ? $maxWidth : $imageSize;
|
||||
|
Reference in New Issue
Block a user