From ec8d7a36a8734ce420ae194ad546e03f6619a03b Mon Sep 17 00:00:00 2001 From: johnnyq Date: Tue, 18 Mar 2025 16:48:05 -0400 Subject: [PATCH] Only store optimized WebP images, so only 1 image is stored and used for thumnails and viewing, removed fields has_preview and has_thumbnail as these are no longer needed, fixed issue when optimizing portrait images the bottom half would get cropped out --- client_files.php | 40 +------- database_updates.php | 15 ++- db.sql | 2 +- includes/database_version.php | 2 +- modals/client_file_view_modal.php | 2 +- post/user/file.php | 148 +++++++++++++----------------- 6 files changed, 83 insertions(+), 126 deletions(-) diff --git a/client_files.php b/client_files.php index 549f7bcf..1232b544 100644 --- a/client_files.php +++ b/client_files.php @@ -322,22 +322,12 @@ while ($folder_id > 0) { $file_size_KB = number_format($file_size / 1024); $file_mime_type = nullable_htmlentities($row['file_mime_type']); $file_uploaded_by = nullable_htmlentities($row['user_name']); - $file_has_thumbnail = intval($row['file_has_thumbnail']); - $file_has_preview = intval($row['file_has_preview']); - $file_thumbnail_source = $file_reference_name; - if ($file_has_thumbnail == 1) { - $file_thumbnail_source = "thumbnail_$file_reference_name"; - } - $file_preview_source = $file_reference_name; - if ($file_has_preview == 1) { - $file_preview_source = "preview_$file_reference_name"; - } // Store file data into an array for JS $files[] = [ 'id' => $file_id, 'name' => $file_name, - 'preview' => "uploads/clients/$client_id/$file_preview_source" + 'preview' => "uploads/clients/$client_id/$file_reference_name" ]; ?> @@ -345,7 +335,7 @@ while ($folder_id > 0) {
- " alt=""> + " alt="">
@@ -356,18 +346,8 @@ while ($folder_id > 0) {