summaryrefslogtreecommitdiff
path: root/src/images.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-05-14 21:42:49 +0500
committerilotterytea <iltsu@alright.party>2025-05-14 21:42:49 +0500
commit6c9badacab7752af09a772c1ce11bdc6651862e7 (patch)
treef9c31a4b76a727b4648a189ea21c1f34a6131fb4 /src/images.php
parent4e29d4041e7cf254041e22d2052e94a7c53c9066 (diff)
upd: return error on mkdir error
Diffstat (limited to 'src/images.php')
-rw-r--r--src/images.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/images.php b/src/images.php
index 9462641..9ec0301 100644
--- a/src/images.php
+++ b/src/images.php
@@ -32,7 +32,9 @@ function resize_image(string $src_path, string $dst_path, int $max_width, int $m
function create_image_bundle(string $src_path, string $dst_path, int $max_width, int $max_height, bool $set_format = true, bool $stretch = false): int|null
{
if (!is_dir($dst_path)) {
- mkdir($dst_path, 0777, true);
+ if (!mkdir($dst_path, 0777, true)) {
+ return -3;
+ }
}
if ($err = resize_image($src_path, "$dst_path/3x", $max_width, $max_height, $set_format, $stretch)) {