From 1d2ec1995704c2d6e82890acb03ef23d92997b6d Mon Sep 17 00:00:00 2001 From: Arpan Rank Date: Tue, 15 May 2018 12:49:03 +0530 Subject: [PATCH] Fix: Original Size Url --- src/ImageType.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/ImageType.php b/src/ImageType.php index ae9d81a..61db0e6 100644 --- a/src/ImageType.php +++ b/src/ImageType.php @@ -187,10 +187,11 @@ public function url(string $filename = null, $sizes = [], $expirationTime = null } $urls = []; + $filename = pathinfo($filename); $this->expirationTime = empty($expirationTime) ? $this->expirationTime : $expirationTime; if (empty($sizes) || in_array('original', $sizes)) { - $output = $this->typeConfig->get('original')['path'] . '/' . $filename; + $output = $this->typeConfig->get('original')['path'] . '/' . $filename['basename']; $storage = Storage::disk($this->originalFileDisk); if ($this->originalDiskConfig['driver'] === 'local' || empty($this->typeConfig->get('original')['private'])) { @@ -200,7 +201,6 @@ public function url(string $filename = null, $sizes = [], $expirationTime = null } } - $filename = pathinfo($filename); $configSizes = $this->typeConfig->get('sizes'); if ($configSizes) { @@ -222,14 +222,14 @@ public function temporaryUrl(string $filename = null, $sizes = [], $expirationTi } $urls = []; + $filename = pathinfo($filename); $this->expirationTime = empty($expirationTime) ? $this->expirationTime : $expirationTime; if (empty($sizes) || in_array('original', $sizes)) { - $output = $this->typeConfig->get('original')['path'] . '/' . $filename; + $output = $this->typeConfig->get('original')['path'] . '/' . $filename['basename']; $urls['original'] = Storage::disk($this->originalFileDisk)->temporaryUrl($output, Carbon::now()->addMinutes($this->expirationTime)); } - $filename = pathinfo($filename); $configSizes = $this->typeConfig->get('sizes'); if ($configSizes) { @@ -247,14 +247,14 @@ public function temporaryUrl(string $filename = null, $sizes = [], $expirationTi public function blob(string $filename, $size = null) { $output = null; + $filename = pathinfo($filename); if (empty($size) || $size === 'original') { - $output = $this->typeConfig->get('original')['path'] . '/' . $filename; + $output = $this->typeConfig->get('original')['path'] . '/' . $filename['basename']; } else { $configSizes = $this->typeConfig->get('sizes'); if (isset($configSizes[$size])) { - $filename = pathinfo($filename); $output = $this->output($filename, $size, $configSizes[$size]); } }