Skip to content

Commit

Permalink
Merge branch 'dev/1.0.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
elevinskii committed Mar 7, 2024
2 parents b1f7640 + 0b606ba commit affbe7f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Console/Command/RemoveMediaDuplicates.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
$duplicateImage = $this->imageBuilder->create($image->getValue());
$originImage = $this->originFinder->getOriginImage($duplicateImage);

if (!$this->isDryRun($input)) {
$this->imageResource->save(
$image->setValue($originImage->getCatalogPath())
);
if ($originImage) {
if (!$this->isDryRun($input)) {
$this->imageResource->save(
$image->setValue($originImage->getCatalogPath())
);
}

$removedImages[] = $duplicateImage;
$totalSize += $duplicateImage->getFileSize();
}

$removedImages[] = $duplicateImage;
$totalSize += $duplicateImage->getFileSize();
} catch (\Exception $exception) {
$this->logger->error($exception->getMessage());
}
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![Latest Stable Version](http://poser.pugx.org/elevinskii/module-media-storage/v)](https://packagist.org/packages/elevinskii/module-media-storage)
[![Total Downloads](http://poser.pugx.org/elevinskii/module-media-storage/downloads)](https://packagist.org/packages/elevinskii/module-media-storage)
[![PHP Version Require](http://poser.pugx.org/elevinskii/module-media-storage/require/php)](https://packagist.org/packages/elevinskii/module-media-storage)

### What's the problem?

That sometimes might be a case when your Magento content managers use the same images with assigning them to
Expand Down

0 comments on commit affbe7f

Please sign in to comment.