summaryrefslogtreecommitdiff
path: root/public/emotes/upload.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-05-12 14:06:00 +0500
committerilotterytea <iltsu@alright.party>2025-05-12 14:06:00 +0500
commit952058eed3a6e8d3eb04dc8795e647ef4f655306 (patch)
tree41da58a4c4ae90bf3fde1826cd5983881c993cce /public/emotes/upload.php
parent01918a6fd58590fe213a8e0f449a607915808b3b (diff)
feat: function for creating image bundles
Diffstat (limited to 'public/emotes/upload.php')
-rw-r--r--public/emotes/upload.php17
1 files changed, 2 insertions, 15 deletions
diff --git a/public/emotes/upload.php b/public/emotes/upload.php
index 5fd2faa..2c37c26 100644
--- a/public/emotes/upload.php
+++ b/public/emotes/upload.php
@@ -369,21 +369,8 @@ if ($is_manual) {
} else {
$image = $_FILES["file"];
// resizing the image
- if ($err = resize_image($image["tmp_name"], "$path/3x", $max_width, $max_height)) {
- error_log("Error processing image: $err");
- generate_alert("/emotes/upload.php", "Error occurred while processing the image ($err)", 500);
- abort_upload($path, $db, $id);
- exit;
- }
- if ($err = resize_image($image["tmp_name"], "$path/2x", $max_width / 2, $max_height / 2)) {
- error_log("Error processing image: $err");
- generate_alert("/emotes/upload.php", "Error occurred while processing the image ($err)", 500);
- abort_upload($path, $db, $id);
- exit;
- }
- if ($err = resize_image($image["tmp_name"], "$path/1x", $max_width / 4, $max_height / 4)) {
- error_log("Error processing image: $err");
- generate_alert("/emotes/upload.php", "Error occurred while processing the image ($err)", 500);
+ if ($err = create_image_bundle($image["tmp_name"], $path, $max_width, $max_height)) {
+ generate_alert("/emotes/upload.php", "Error occurred while processing images ($err)", 500);
abort_upload($path, $db, $id);
exit;
}