From 27c70cf79dc154ce4632e56dbbc0996e25c01507 Mon Sep 17 00:00:00 2001 From: Steven Dodd Date: Sun, 10 Aug 2025 12:36:33 +0000 Subject: [PATCH 1/7] Added gallery tab for eQSL cards --- application/views/eqslcard/index.php | 98 ++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) diff --git a/application/views/eqslcard/index.php b/application/views/eqslcard/index.php index 4d258086..91db4632 100644 --- a/application/views/eqslcard/index.php +++ b/application/views/eqslcard/index.php @@ -8,6 +8,21 @@ lang->line('qslcard_string_your_are_using'); ?> lang->line('qslcard_string_disk_space'); ?> +
+
+ +
+ +
+
+
session->userdata('user_date_format')) { @@ -55,5 +70,88 @@ echo ''; } ?> +
+
From 97e21151283eb3817e12c8161cbf702af1eb2b6c Mon Sep 17 00:00:00 2001 From: Steven Dodd Date: Sun, 10 Aug 2025 13:23:56 +0000 Subject: [PATCH 2/7] Added check for GD functions --- application/views/eqslcard/index.php | 53 +++++++++++++++------------- 1 file changed, 28 insertions(+), 25 deletions(-) diff --git a/application/views/eqslcard/index.php b/application/views/eqslcard/index.php index 91db4632..ec940db6 100644 --- a/application/views/eqslcard/index.php +++ b/application/views/eqslcard/index.php @@ -122,35 +122,38 @@ - result())) { - foreach ($qslarray->result() as $qsl) { - $src = $folder_name.'/'.$qsl->image_file; - $dest = $folder_name.'/_'.$qsl->image_file; - if (file_exists($folder_name.'/_'.$qsl->image_file) == false) { - /* read the source image */ - $data = file_get_contents( $src ); - $source_image = imagecreatefromstring( $data ); - $width = imagesx( $source_image ); - $height = imagesy( $source_image ); +result())) { + foreach ($qslarray->result() as $qsl) { + $src = $folder_name.'/'.$qsl->image_file; + $dest = $folder_name.'/_'.$qsl->image_file; + if (file_exists($folder_name.'/_'.$qsl->image_file) == false) { + /* read the source image */ + $data = file_get_contents( $src ); + $source_image = imagecreatefromstring( $data ); + $width = imagesx( $source_image ); + $height = imagesy( $source_image ); - /* create a new, "virtual" image */ - $virtual_image = imagecreatetruecolor( $desired_width, $desired_height ); + /* find the "desired height" of this thumbnail, relative to the desired width */ + $desired_height = floor( $height * ( $desired_width / $width ) ); - /* copy source image at a resized size */ - imagecopyresampled( $virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height ); + /* create a new, "virtual" image */ + $virtual_image = imagecreatetruecolor( $desired_width, $desired_height ); - /* create the physical thumbnail image to its destination */ - imagejpeg( $virtual_image, $dest, 60 ); - } - echo ''; - } - } + /* copy source image at a resized size */ + imagecopyresampled( $virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $width, $height ); + + /* create the physical thumbnail image to its destination */ + imagejpeg( $virtual_image, $dest, 60 ); + } + echo ''; + } + } + } ?> From 5fe24614e1216c6c846db5cc857c62bc71fd3150 Mon Sep 17 00:00:00 2001 From: Steven Dodd Date: Sun, 10 Aug 2025 14:06:43 +0000 Subject: [PATCH 3/7] Addressed Copilot issues --- application/views/eqslcard/index.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/application/views/eqslcard/index.php b/application/views/eqslcard/index.php index ec940db6..f8cea5fd 100644 --- a/application/views/eqslcard/index.php +++ b/application/views/eqslcard/index.php @@ -121,18 +121,21 @@ - + result())) { foreach ($qslarray->result() as $qsl) { + if ($thumb_generations >=0) { $src = $folder_name.'/'.$qsl->image_file; $dest = $folder_name.'/_'.$qsl->image_file; - if (file_exists($folder_name.'/_'.$qsl->image_file) == false) { - /* read the source image */ + if (!file_exists($folder_name.'/_'.$qsl->image_file)) { + $thumb_generations--; + /* read the source image */ $data = file_get_contents( $src ); $source_image = imagecreatefromstring( $data ); $width = imagesx( $source_image ); @@ -151,8 +154,11 @@ imagejpeg( $virtual_image, $dest, 60 ); } echo ''; + } } } + } else { + echo 'Gallery requires GD libraries to be installed https://www.php.net/manual/en/image.installation.php'; } ?> From c92f438a4ca56e8b18652bc2c4c803a7d0a8fe4e Mon Sep 17 00:00:00 2001 From: Steven Dodd Date: Sun, 10 Aug 2025 15:19:08 +0000 Subject: [PATCH 4/7] Added scrollbar to gallery --- application/views/eqslcard/index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/application/views/eqslcard/index.php b/application/views/eqslcard/index.php index f8cea5fd..bbacfd34 100644 --- a/application/views/eqslcard/index.php +++ b/application/views/eqslcard/index.php @@ -71,7 +71,7 @@ } ?> -