diff --git a/src/Utils/Image.php b/src/Utils/Image.php index 34ea2f44c..48c9ec599 100644 --- a/src/Utils/Image.php +++ b/src/Utils/Image.php @@ -492,6 +492,10 @@ public function save(string $file = null, int $quality = null, int $type = null) $type = $extensions[$ext]; } + if (array_key_exists($type, self::$formats) && $file != null) { + FileSystem::createDir(dirname($file)); + } + switch ($type) { case self::JPEG: $quality = $quality === null ? 85 : max(0, min(100, $quality));