From 6b478634a9946161f92f17b0159ccfe244d12c91 Mon Sep 17 00:00:00 2001 From: Devdatt Bhatt Date: Wed, 20 May 2026 12:34:02 +0000 Subject: [PATCH] update --- encoder/app.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/encoder/app.php b/encoder/app.php index ccd16d7..c06e0b7 100644 --- a/encoder/app.php +++ b/encoder/app.php @@ -11,7 +11,7 @@ https://github.com/shreebhatt_ji/Urmi/blob/main/licence.md $json_file = '/var/www/html/app.json'; $error_message = ''; -// --- 1. Handle Form Submission BEFORE any HTML is sent --- +// --- 1. Handle Form Submission BEFORE any HTML is if (isset($_POST['submit'])) { $upload_paths = [ 'app_ad' => '/var/www/html/app_ad.png', @@ -21,7 +21,7 @@ if (isset($_POST['submit'])) { $errors = []; - // Handle File Deletions (Remove feature) + // Handle File Deletions $to_delete = $_POST['remove_files'] ?? []; foreach ($to_delete as $file_key => $should_delete) { if ($should_delete === '1' && isset($upload_paths[$file_key])) { @@ -35,7 +35,6 @@ if (isset($_POST['submit'])) { } } - // Handle File Uploads foreach ($upload_paths as $input_name => $destination) { if (isset($_FILES[$input_name]) && $_FILES[$input_name]['error'] == 0) { $tmp_path = $_FILES[$input_name]['tmp_name']; @@ -69,7 +68,7 @@ if (isset($_POST['submit'])) { // 6. Resize (Resample) imagecopyresampled( - $dst_img, + $dest_img, $src_img, 0, 0, @@ -83,7 +82,8 @@ if (isset($_POST['submit'])) { // 7. Save to primary destination with compression (level 7) if (imagepng($dst_img, $destination, 7)) { - $filename = basename($int_name); + // FIXED: Changed $int_name to $destination + $filename = basename($destination); $secondary_destination = $secondary_dir . $filename; if (!copy($destination, $secondary_destination)) { @@ -205,7 +205,7 @@ include 'header.php';
- +
New file selected (will upload on save)
@@ -227,6 +227,7 @@ include 'header.php';
New file selected (will upload on save)
+ Current: