File tree Expand file tree Collapse file tree 1 file changed +16
-7
lines changed
app/code/Magento/Cms/Model/Wysiwyg/Images Expand file tree Collapse file tree 1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -423,13 +423,22 @@ public function getFilesCollection($path, $type = null)
423
423
}
424
424
425
425
try {
426
- $ size = getimagesizefromstring (
427
- $ driver ->fileGetContents ($ item ->getFilename ())
428
- );
429
-
430
- if (is_array ($ size )) {
431
- $ item ->setWidth ($ size [0 ]);
432
- $ item ->setHeight ($ size [1 ]);
426
+ if ($ item ->getSize () > 0 ) {
427
+ $ size = getimagesizefromstring (
428
+ $ driver ->fileGetContents ($ item ->getFilename ())
429
+ );
430
+
431
+ if (is_array ($ size )) {
432
+ $ item ->setWidth ($ size [0 ]);
433
+ $ item ->setHeight ($ size [1 ]);
434
+ }
435
+ } else {
436
+ $ this ->logger ->notice (
437
+ sprintf (
438
+ "The image file %s cannot be processed by the Gallery because it has an invalid size. " ,
439
+ $ item ->getFilename ()
440
+ )
441
+ );
433
442
}
434
443
} catch (\Error $ e ) {
435
444
$ this ->logger ->notice (sprintf ("GetImageSize caused error: %s " , $ e ->getMessage ()));
You can’t perform that action at this time.
0 commit comments