Skip to content

Commit 9182430

Browse files
committed
B2B-2060: getimagesize() warning on tests when using remote storage AWS S3
1 parent ce524f6 commit 9182430

File tree

2 files changed

+5
-4
lines changed
  • app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File
  • dev/tests/integration/testsuite/Magento/Catalog/Model/Webapi/Product/Option/Type/File

2 files changed

+5
-4
lines changed

app/code/Magento/Catalog/Model/Webapi/Product/Option/Type/File/Processor.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,12 @@ public function processFileContent(ImageContentInterface $imageContent)
6363
{
6464
$filePath = $this->saveFile($imageContent);
6565

66-
$directory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
67-
$fileAbsolutePath = $directory->getAbsolutePath($filePath);
68-
$fileContent = $directory->readFile($filePath);
66+
$mediaDirectory = $this->filesystem->getDirectoryRead(DirectoryList::MEDIA);
67+
$fileAbsolutePath = $mediaDirectory->getAbsolutePath($filePath);
68+
$fileContent = $mediaDirectory->readFile($filePath);
6969
$fileHash = hash('sha256', $fileContent);
7070
$imageSize = getimagesizefromstring($fileContent);
71-
$stat = $directory->stat($fileAbsolutePath);
71+
$stat = $mediaDirectory->stat($fileAbsolutePath);
7272
$result = [
7373
'type' => $imageContent->getType(),
7474
'title' => $imageContent->getName(),

dev/tests/integration/testsuite/Magento/Catalog/Model/Webapi/Product/Option/Type/File/ProcessorTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ public function testProcessFileContent($pathConfig)
3535
'size' => 212,
3636
'width' => 10,
3737
'height' => 10,
38+
'secret_key' => 'bc9577055da436b9c116',
3839
];
3940
$imageContent->setName('my_file');
4041
$imageContent->setType('image/png');

0 commit comments

Comments
 (0)