File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
app/code/Magento/Cms/Model/Wysiwyg/Images Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -629,7 +629,12 @@ public function resizeFile($source, $keepRatio = true)
629
629
$ image = $ this ->_imageFactory ->create ();
630
630
$ image ->open ($ source );
631
631
$ image ->keepAspectRatio ($ keepRatio );
632
- $ image ->resize ($ this ->_resizeParameters ['width ' ], $ this ->_resizeParameters ['height ' ]);
632
+ list ($ imageWidth , $ imageHeight ) = getimagesize ($ source );
633
+
634
+ $ image ->resize (
635
+ $ this ->_resizeParameters ['width ' ] > $ imageWidth ? $ imageWidth : $ this ->_resizeParameters ['width ' ],
636
+ $ this ->_resizeParameters ['height ' ] > $ imageHeight ? $ imageHeight : $ this ->_resizeParameters ['height ' ]
637
+ );
633
638
$ dest = $ targetDir . '/ ' . $ this ->ioFile ->getPathInfo ($ source )['basename ' ];
634
639
$ image ->save ($ dest );
635
640
if ($ this ->_directory ->isFile ($ this ->_directory ->getRelativePath ($ dest ))) {
You can’t perform that action at this time.
0 commit comments