You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if ($image->getWidth() < $width || $image->getHeight() < $height) {
443
+
if ($scaling) {
444
+
$errors[] = $this->t('The resized image is too small. The minimum dimensions are %dimensions pixels and after resizing, the image size will be %widthx%height pixels.',
445
+
[
446
+
'%dimensions' => $minimum_dimensions,
447
+
'%width' => $image->getWidth(),
448
+
'%height' => $image->getHeight(),
449
+
]);
450
+
}
451
+
else {
452
+
$errors[] = $this->t('The image is too small. The minimum dimensions are %dimensions pixels and the image size is %widthx%height pixels.',
453
+
[
454
+
'%dimensions' => $minimum_dimensions,
455
+
'%width' => $image->getWidth(),
456
+
'%height' => $image->getHeight(),
457
+
]);
458
+
}
459
+
}
460
+
}
461
+
}
462
+
463
+
return$errors;
464
+
}
465
+
373
466
/**
374
467
* Prepares the filename to strip out any malicious extensions.
'The image is too small. The minimum dimensions are <em class="placeholder">15x15</em> pixels and the image size is <em class="placeholder">10</em>x<em class="placeholder">10</em> pixels.',
195
+
$violations[0]['message']
196
+
);
197
+
}
198
+
149
199
/**
150
200
* Tests that the uploaded file extension is renamed to txt.
151
201
*/
@@ -205,6 +255,7 @@ public function testLockReleased(): void {
205
255
\Drupal::service('config.factory'),
206
256
\Drupal::service('renderer'),
207
257
\Drupal::service('event_dispatcher'),
258
+
\Drupal::service('image.factory'),
208
259
);
209
260
210
261
// Create a Symfony dummy uploaded file in test mode.
0 commit comments