summaryrefslogtreecommitdiff
path: root/includes/logo.inc
diff options
context:
space:
mode:
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