File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
app/code/Magento/Cms/Model/Wysiwyg/Images Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -415,7 +415,7 @@ public function getFilesCollection($path, $type = null)
415415 $ mimeType = $ itemStats ['mimetype ' ] ?? $ this ->mime ->getMimeType ($ item ->getFilename ());
416416 $ item ->setMimeType ($ mimeType );
417417
418- if ($ this ->isImage ($ item ->getBasename ())) {
418+ if ($ this ->isImage ($ item ->getBasename ()) && $ item -> getSize () > 0 ) {
419419 $ thumbUrl = $ this ->getThumbnailUrl ($ item ->getFilename (), true );
420420 // generate thumbnail "on the fly" if it does not exists
421421 if (!$ thumbUrl ) {
@@ -435,6 +435,12 @@ public function getFilesCollection($path, $type = null)
435435 $ this ->logger ->notice (sprintf ("GetImageSize caused error: %s " , $ e ->getMessage ()));
436436 }
437437 } else {
438+ $ this ->logger ->warning (
439+ sprintf (
440+ "The image %s is invalid and cannot be displayed in the gallery. " ,
441+ $ item ->getBasename ()
442+ )
443+ );
438444 $ thumbUrl = $ this ->_assetRepo ->getUrl (self ::THUMB_PLACEHOLDER_PATH_SUFFIX );
439445 }
440446
You can’t perform that action at this time.
0 commit comments