File tree Expand file tree Collapse file tree 2 files changed +11
-8
lines changed
app/code/Magento/Catalog/Model/Product
dev/tests/integration/testsuite/Magento/Catalog/controllers/_files Expand file tree Collapse file tree 2 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -942,15 +942,11 @@ public function getResizedImageInfo()
942
942
{
943
943
$ fileInfo = null ;
944
944
if ($ this ->_newFile === true ) {
945
- $ sourceFile = $ this ->_assetRepo ->createAsset (
945
+ $ asset = $ this ->_assetRepo ->createAsset (
946
946
"Magento_Catalog::images/product/placeholder/ {$ this ->getDestinationSubdir ()}.jpg "
947
- )->getSourceFile ();
948
- if ($ this ->_mediaDirectory ->isFile ($ sourceFile )) {
949
- try {
950
- $ fileInfo = getimagesize ($ sourceFile );
951
- } catch (Exception $ e ) {
952
- }
953
- }
947
+ );
948
+ $ img = $ asset ->getSourceFile ();
949
+ $ fileInfo = getimagesize ($ img );
954
950
} else {
955
951
if ($ this ->_mediaDirectory ->isFile ($ this ->_mediaDirectory ->getAbsolutePath ($ this ->_newFile ))) {
956
952
$ fileInfo = getimagesize ($ this ->_mediaDirectory ->getAbsolutePath ($ this ->_newFile ));
Original file line number Diff line number Diff line change 9
9
use Magento \Framework \App \Filesystem \DirectoryList ;
10
10
11
11
$ obectManager = \Magento \TestFramework \Helper \Bootstrap::getObjectManager ();
12
+
13
+ $ obectManager ->get (
14
+ 'Magento\Framework\View\DesignInterface '
15
+ )->setArea (
16
+ 'frontend '
17
+ )->setDefaultDesignTheme ();
18
+
12
19
/** @var \Magento\Catalog\Model\Product\Media\Config $config */
13
20
$ config = $ obectManager ->get ('Magento\Catalog\Model\Product\Media\Config ' );
14
21
/** @var \Magento\Framework\Filesystem\Directory\WriteInterface $mediaDirectory */
You can’t perform that action at this time.
0 commit comments