summaryrefslogtreecommitdiff
path: root/includes/logo.inc
diff options
context:
space:
mode:
authorMinteck <contact@minteck.org>2022-11-11 23:47:49 +0100
committerMinteck <contact@minteck.org>2022-11-11 23:47:49 +0100
commit209356b8ade1920b50d1d3a1a5e121c6623d167b (patch)
tree5301396987d1510f715a0b1c24754873af19e1dc /includes/logo.inc
parent2c4ae43e688a9873e86211ea0e7aeb9ba770dd77 (diff)
downloadpluralconnect-209356b8ade1920b50d1d3a1a5e121c6623d167b.tar.gz
pluralconnect-209356b8ade1920b50d1d3a1a5e121c6623d167b.tar.bz2
pluralconnect-209356b8ade1920b50d1d3a1a5e121c6623d167b.zip
Update
Diffstat (limited to 'includes/logo.inc')
-rw-r--r--includes/logo.inc16
1 files changed, 13 insertions, 3 deletions
diff --git a/includes/logo.inc b/includes/logo.inc
index 442ff2b..9b4a03f 100644
--- a/includes/logo.inc
+++ b/includes/logo.inc
@@ -4,7 +4,9 @@ require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/functions.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/bitset.inc";
require_once $_SERVER['DOCUMENT_ROOT'] . "/includes/score.inc";
-$columns = round(sqrt(count(scoreOrderGlobal())));
+$columns = ceil(sqrt(count(scoreOrderGlobal())));
+echo(" Using " . $columns . " columns\n");
+
$members = scoreOrderGlobal();
usort($members, function ($a, $b) {
@@ -27,6 +29,8 @@ usort($members, function ($a, $b) {
return $ra - $rb;
});
+echo(" " . count($members) . " members\n");
+
$packs = [];
$currentPack = [];
@@ -71,7 +75,11 @@ $factor = 64;
for ($y = 0; $y < $columns; ++$y) {
for ($x = 0; $x < $columns; ++$x) {
- imagesetpixel($img, $x, $y, imagecolorallocate($img, hexdec(substr($newPacks[$y][$x], 0, 2)), hexdec(substr($newPacks[$y][$x], 2, 2)), hexdec(substr($newPacks[$y][$x], 4, 2))));
+ if (isset($newPacks[$y][$x])) {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, hexdec(substr($newPacks[$y][$x], 0, 2)), hexdec(substr($newPacks[$y][$x], 2, 2)), hexdec(substr($newPacks[$y][$x], 4, 2))));
+ } else {
+ imagesetpixel($img, $x, $y, imagecolorallocate($img, 255, 255, 255));
+ }
}
}
@@ -83,6 +91,7 @@ $img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
unlink("/tmp/image.png");
imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo.png");
+imagepng($img3, "/tmp/ponieslogo1.png");
for ($x = 1; $x <= 120; $x++) {
imagefilter($img2, IMG_FILTER_GAUSSIAN_BLUR);
@@ -94,4 +103,5 @@ imagepng($img2, "/tmp/image.png");
$img3 = imageCreateCorners("/tmp/image.png", $columns * 10);
unlink("/tmp/image.png");
-imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo-template.png"); \ No newline at end of file
+imagepng($img3, $_SERVER['DOCUMENT_ROOT'] . "/assets/logo/newlogo-template.png");
+imagepng($img3, "/tmp/ponieslogo2.png"); \ No newline at end of file