From a3522672930578959980e39b7041b120c13cd6cf Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Thu, 15 May 2025 02:32:54 +0500 Subject: feat: show emote file sizes and dimensions --- public/system/emotes/index.php | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) (limited to 'public/system/emotes/index.php') diff --git a/public/system/emotes/index.php b/public/system/emotes/index.php index bcc1441..2a48408 100644 --- a/public/system/emotes/index.php +++ b/public/system/emotes/index.php @@ -121,13 +121,32 @@ if (isset($_GET["id"])) { ?>
-
- /1x.webp" - alt=""> - /2x.webp" - alt=""> - /3x.webp" - alt=""> +
+ '; + + echo ''; + + $path = $_SERVER["DOCUMENT_ROOT"] . '/static/userdata/emotes/' . $emote["id"] . "/{$size}x.webp"; + + echo '
'; + + if ($file_size = filesize($path)) { + $kb = sprintf("%.2f", $file_size / 1024); + echo "

{$kb}KB

"; + } + + if ($image_size = getimagesize($path)) { + echo "

$image_size[0]x$image_size[1]

"; + } + + echo '
'; + } + ?>
-- cgit v1.2.3