summaryrefslogtreecommitdiff
path: root/public/system/emotes/index.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-05-15 02:32:54 +0500
committerilotterytea <iltsu@alright.party>2025-05-15 02:32:54 +0500
commita3522672930578959980e39b7041b120c13cd6cf (patch)
tree18925802226493d76e958e8e0e71f56cd3cf6671 /public/system/emotes/index.php
parent2e84e2a301fe270f6911f597149cd88d9dc85abe (diff)
feat: show emote file sizes and dimensions
Diffstat (limited to 'public/system/emotes/index.php')
-rw-r--r--public/system/emotes/index.php33
1 files changed, 26 insertions, 7 deletions
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"])) {
?>
</div>
<div class="box content">
- <div class="emote-showcase">
- <img src="/static/userdata/emotes/<?php echo $emote["id"] ?>/1x.webp"
- alt="<?php echo $emote["id"] ?>">
- <img src="/static/userdata/emotes/<?php echo $emote["id"] ?>/2x.webp"
- alt="<?php echo $emote["id"] ?>">
- <img src="/static/userdata/emotes/<?php echo $emote["id"] ?>/3x.webp"
- alt="<?php echo $emote["id"] ?>">
+ <div class="emote-showcase items-bottom">
+ <?php
+ for ($size = 1; $size < 4; $size++) {
+ echo '<div class="column items-center small-gap">';
+
+ echo '<img src="/static/userdata/emotes/';
+ echo $emote["id"];
+ echo "/{$size}x.webp\"";
+ echo 'title="' . $emote["code"] . '" />';
+
+ $path = $_SERVER["DOCUMENT_ROOT"] . '/static/userdata/emotes/' . $emote["id"] . "/{$size}x.webp";
+
+ echo '<div class="column items-center">';
+
+ if ($file_size = filesize($path)) {
+ $kb = sprintf("%.2f", $file_size / 1024);
+ echo "<p class='font-small'>{$kb}KB</p>";
+ }
+
+ if ($image_size = getimagesize($path)) {
+ echo "<p class='font-small'>$image_size[0]x$image_size[1]</p>";
+ }
+
+ echo '</div></div>';
+ }
+ ?>
</div>
</div>
</section>