Skip to content

Commit 97e43c1

Browse files
committed
8204: catalog:images:resize = getimagesize(): Read error!
1 parent 9e85ead commit 97e43c1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

app/code/Magento/Catalog/Console/Command/ImagesResizeCommand.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
7474
return \Magento\Framework\Console\Cli::RETURN_SUCCESS;
7575
}
7676

77-
$exceptionMessage = '';
77+
$errorMessage = '';
7878
try {
7979
foreach ($productIds as $productId) {
8080
try {
@@ -88,8 +88,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
8888
/** @var \Magento\Catalog\Model\Product\Image\Cache $imageCache */
8989
$imageCache = $this->imageCacheFactory->create();
9090
$imageCache->generate($product);
91-
} catch (\Exception $e) {
92-
$exceptionMessage = $e->getMessage();
91+
} catch (\Magento\Framework\Exception\RuntimeException $e) {
92+
$errorMessage = $e->getMessage();
9393
}
9494

9595
$output->write(".");
@@ -103,8 +103,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
103103
$output->write("\n");
104104
$output->writeln("<info>Product images resized successfully.</info>");
105105

106-
if ($exceptionMessage) {
107-
$output->writeln("<comment>{$exceptionMessage}</comment>");
106+
if ($errorMessage !== '') {
107+
$output->writeln("<comment>{$errorMessage}</comment>");
108108
}
109109

110110
return 0;

0 commit comments

Comments
 (0)