Skip to content

Commit 553b426

Browse files
committed
Merge pull request #39 from jdecool/fix-folder-error-original-copy
Create folder if not exist when copy original file
2 parents 72d6a79 + 57c1c59 commit 553b426

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Manager/ResizeManager.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ public function transform($sourcePath, $destPathWithFormat, $format)
6262
$confFallback = $this->defaultConfiguration['fallback'];
6363

6464
if ($format === 'original') {
65+
$dir = dirname($destPathWithFormat);
66+
if (!file_exists($dir)) {
67+
mkdir($dir, 0777, true);
68+
}
69+
6570
copy($sourcePath, $destPathWithFormat);
6671
return;
6772
}

0 commit comments

Comments
 (0)