Skip to content

Commit 8b97bd0

Browse files
authored
Merge pull request #7 from avored/dev
bug fixed for image path
2 parents d587e51 + af331d9 commit 8b97bd0

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

src/Image/LocalFile.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class LocalFile
2828
public function __construct($relativePath = null)
2929
{
3030
$this->relativePath = $relativePath;
31-
$this->url = asset($relativePath);
31+
$this->url = asset('storage' . DIRECTORY_SEPARATOR . $relativePath);
3232

3333
$sizes = config('avored-framework.image.sizes');
3434

@@ -38,7 +38,7 @@ public function __construct($relativePath = null)
3838
$baseName = basename($relativePath);
3939
$sizeNamePath = str_replace($baseName, $sizeName . '-' . $baseName, $relativePath);
4040

41-
$this->$objectVarName = asset($sizeNamePath);
41+
$this->$objectVarName = asset('storage' . DIRECTORY_SEPARATOR . $sizeNamePath);
4242
}
4343
}
4444

src/Image/Service.php

+1-5
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ private function openImage($file)
9898
{
9999
// *** Get extension
100100
$extension = strtolower(strrchr($file, '.'));
101-
102-
103101
switch ($extension) {
104102
case '.jpg':
105103
case '.jpeg':
@@ -295,10 +293,8 @@ public function saveImage($savePath, $imageQuality = '100')
295293
}
296294
break;
297295

298-
// ... etc
299-
300296
default:
301-
// *** No extension - No save.
297+
302298
break;
303299
}
304300

0 commit comments

Comments
 (0)