Skip to content

Commit 78374e0

Browse files
author
MateuszKolankowski
committed
Simplified temporary file URI access in image processing logic.
1 parent d729971 commit 78374e0

File tree

4 files changed

+4
-10
lines changed

4 files changed

+4
-10
lines changed

src/bundle/Core/Command/ResizeOriginalImagesCommand.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,8 +302,7 @@ private function store(BinaryInterface $binary, Value $image): BinaryFile
302302
$tmpFile = tmpfile();
303303
fwrite($tmpFile, $binary->getContent());
304304
$tmpMetadata = stream_get_meta_data($tmpFile);
305-
$tmpPath = $tmpMetadata['uri'];
306-
$binaryCreateStruct = $this->ioService->newBinaryCreateStructFromLocalFile($tmpPath);
305+
$binaryCreateStruct = $this->ioService->newBinaryCreateStructFromLocalFile($tmpMetadata['uri']);
307306
$binaryCreateStruct->id = $image->id;
308307
$newBinaryFile = $this->ioService->createBinaryFile($binaryCreateStruct);
309308
fclose($tmpFile);

src/bundle/Core/Imagine/IORepositoryResolver.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ public function store(BinaryInterface $binary, $path, $filter)
9292
$tmpFile = tmpfile();
9393
fwrite($tmpFile, $binary->getContent());
9494
$tmpMetadata = stream_get_meta_data($tmpFile);
95-
$tmpPath = $tmpMetadata['uri'];
96-
$binaryCreateStruct = $this->ioService->newBinaryCreateStructFromLocalFile($tmpPath);
95+
$binaryCreateStruct = $this->ioService->newBinaryCreateStructFromLocalFile($tmpMetadata['uri']);
9796
$binaryCreateStruct->id = $this->getFilePath($path, $filter);
9897
$this->ioService->createBinaryFile($binaryCreateStruct);
9998

src/bundle/Core/Imagine/PlaceholderProvider/GenericProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ private function getPlaceholderText(string $pattern, ImageValue $value): string
8484

8585
private function getTemporaryPath(): string
8686
{
87-
$tmpMetadata = stream_get_meta_data(tmpfile());
88-
89-
return $tmpMetadata['uri'];
87+
return stream_get_meta_data(tmpfile())['uri'];
9088
}
9189

9290
private function resolveOptions(array $options): array

src/bundle/Core/Imagine/PlaceholderProvider/RemoteProvider.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,7 @@ private function getPlaceholderUrl(string $urlPattern, ImageValue $value): strin
7777

7878
private function getTemporaryPath(): string
7979
{
80-
$tmpMetadata = stream_get_meta_data(tmpfile());
81-
82-
return $tmpMetadata['uri'];
80+
return stream_get_meta_data(tmpfile())['uri'];
8381
}
8482

8583
private function resolveOptions(array $options): array

0 commit comments

Comments
 (0)