summaryrefslogtreecommitdiff
path: root/includes/external/photo
diff options
context:
space:
mode:
authorRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
committerRaindropsSys <raindrops@equestria.dev>2023-11-17 23:25:29 +0100
commit953ddd82e48dd206cef5ac94456549aed13b3ad5 (patch)
tree8f003106ee2e7f422e5a22d2ee04d0db302e66c0 /includes/external/photo
parent62a9199846b0c07c03218703b33e8385764f42d9 (diff)
downloadpluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.gz
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.tar.bz2
pluralconnect-953ddd82e48dd206cef5ac94456549aed13b3ad5.zip
Updated 30 files and deleted 2976 files (automated)
Diffstat (limited to 'includes/external/photo')
-rw-r--r--includes/external/photo/5-2.pngbin6935 -> 0 bytes
-rw-r--r--includes/external/photo/5.pngbin6000 -> 0 bytes
-rw-r--r--includes/external/photo/canvas.pngbin363 -> 0 bytes
-rw-r--r--includes/external/photo/index.js162
-rw-r--r--includes/external/photo/output.pngbin64235 -> 0 bytes
-rw-r--r--includes/external/photo/run.sh3
-rw-r--r--includes/external/photo/temp.pngbin2079 -> 0 bytes
7 files changed, 0 insertions, 165 deletions
diff --git a/includes/external/photo/5-2.png b/includes/external/photo/5-2.png
deleted file mode 100644
index 5319d67..0000000
--- a/includes/external/photo/5-2.png
+++ /dev/null
Binary files differ
diff --git a/includes/external/photo/5.png b/includes/external/photo/5.png
deleted file mode 100644
index bc6d8d8..0000000
--- a/includes/external/photo/5.png
+++ /dev/null
Binary files differ
diff --git a/includes/external/photo/canvas.png b/includes/external/photo/canvas.png
deleted file mode 100644
index a6e5e8f..0000000
--- a/includes/external/photo/canvas.png
+++ /dev/null
Binary files differ
diff --git a/includes/external/photo/index.js b/includes/external/photo/index.js
deleted file mode 100644
index fda0163..0000000
--- a/includes/external/photo/index.js
+++ /dev/null
@@ -1,162 +0,0 @@
-const fs = require('fs');
-const cp = require('child_process');
-const child_process = require("child_process");
-const number = require('../../app.json')['signal']['raindrops'];
-
-let bottom = [
- "jybgq",
- "auvwc",
- "mvaws",
- "wnujv"
-];
-
-let ponies = [...require('../../data/gdapd/members.json').filter(i => {
- return fs.existsSync("../../data/metadata/" + i.id + ".json") && !require("../../data/metadata/" + i.id + ".json").species.includes("human");
-}), ...require('../../data/ynmuc/members.json').filter(i => {
- return fs.existsSync("../../data/metadata/" + i.id + ".json") && !require("../../data/metadata/" + i.id + ".json").species.includes("human");
-})];
-let columns = Math.ceil(Math.sqrt(ponies.length));
-console.log(ponies.length + " ponies, so the image will contain " + columns + "x" + columns + " ponies");
-
-let list = [];
-
-for (let pony of ponies) {
- if (list.includes(pony.name) || bottom.includes(pony.id)) continue;
-
- let metadata = require("../../data/metadata/" + pony.id + ".json");
- let relations = [...(metadata.marefriends ?? []), ...(metadata.sisters ?? []), ...(metadata.caretakers ?? [])]
-
- list.push(pony.name);
-
- for (let relation of relations) {
- let relationPony = ponies.filter(i => i.id === relation.split("/")[1])[0] ?? null;
- if (relationPony) {
- if (!list.includes(relationPony.name) && !bottom.includes(pony.id)) list.push(relationPony.name);
- }
- }
-}
-
-for (let id of bottom) {
- let pony = ponies.filter(i => i.id === id)[0] ?? null;
- if (list.includes(pony.name)) continue;
-
- let metadata = require("../../data/metadata/" + pony.id + ".json");
- let relations = [...(metadata.marefriends ?? []), ...(metadata.sisters ?? []), ...(metadata.caretakers ?? [])]
-
- list.push(pony.name);
-
- for (let relation of relations) {
- let relationPony = ponies.filter(i => i.id === relation.split("/")[1])[0] ?? null;
- if (relationPony) {
- if (!list.includes(relationPony.name)) list.push(relationPony.name);
- }
- }
-}
-
-let lines = [];
-while (list.length > 0) lines.push(list.splice(0, columns));
-
-if (fs.existsSync("./output.png")) fs.unlinkSync("./output.png");
-
-for (let index1 in lines) {
- process.stdout.write(index1 + ": ");
- index1 = parseInt(index1);
- let line = lines[index1];
-
- let toRemove;
-
- for (let index2 in line) {
- index2 = parseInt(index2);
- let cell = line[index2];
-
- let pony = ponies.filter(i => i.name === cell)[0] ?? null;
- process.stdout.write(pony.id);
- if (pony) {
- if (fs.existsSync("../../../assets/ponies/" + pony.id + ".png")) {
- if (!fs.existsSync("./" + index1 + ".png")) {
- cp.execFileSync("convert", ["../../../assets/ponies/" + pony.id + ".png", "-filter", "Point", "-resize", "x240", "./" + index1 + ".png"]);
- process.stdout.write("...");
-
- toRemove = parseInt(cp.execFileSync("identify", ["-format", "%w", "./" + index1 + ".png"]).toString()) / 2;
- process.stdout.write("...");
- } else {
- let width1 = (index2 + 1) * 240;
- let width2 = index2 * 120;
-
- cp.execFileSync("convert", ["../../../assets/ponies/" + pony.id + ".png", "-filter", "Point", "-resize", "x240", "./temp.png"]);
- process.stdout.write(".");
- cp.execFileSync("convert", ["-size", width1 + "x240", "xc:transparent", "canvas.png"]);
- process.stdout.write(".");
- cp.execFileSync("convert", ["canvas.png", "-colorspace", "sRGB", "./temp.png", "-geometry", "+" + width2 + "+0", "-composite", "./temp.png"]);
- process.stdout.write(".");
- cp.execFileSync("convert", ["./" + index1 + ".png", "-background", "none", "-extent", width1 + "x240", "./" + index1 + "-2.png"]);
- process.stdout.write(".");
- cp.execFileSync("convert", ["./" + index1 + "-2.png", "./temp.png", "-background", "none", "-flatten", "-trim", "+repage", "./" + index1 + "-3.png"]);
- process.stdout.write(".");
-
- fs.unlinkSync("./" + index1 + "-2.png");
- fs.unlinkSync("./" + index1 + ".png");
- fs.renameSync("./" + index1 + "-3.png", "./" + index1 + ".png");
- process.stdout.write(".");
- }
-
- process.stdout.write(", ");
- }
- }
- }
-
- if (!fs.existsSync("./output.png")) {
- cp.execFileSync("convert", ["./" + index1 + ".png", "./output.png"]);
- process.stdout.write("....");
- fs.unlinkSync("./" + index1 + ".png");
- process.stdout.write("...");
- } else {
- let height1 = (index1 + 1) * 480;
- let height2 = index1 * 120;
-
- cp.execFileSync("convert", ["./" + index1 + ".png", "-filter", "Point", "-resize", "x240", "./temp.png"]);
- process.stdout.write(".");
- cp.execFileSync("convert", ["-size", (columns * 240) + "x" + height1, "xc:transparent", "canvas.png"]);
- process.stdout.write(".");
-
- cp.execFileSync("convert", ["canvas.png", "-colorspace", "sRGB", "./temp.png", "-geometry", "+0+" + height2, "-composite", "./temp.png"]);
- process.stdout.write(".");
- cp.execFileSync("convert", ["./output.png", "-background", "none", "-extent", (columns * 240) + "x" + height1, "./output-2.png"]);
- process.stdout.write(".");
- cp.execFileSync("convert", ["./output-2.png", "./temp.png", "-background", "none", "-gravity", "Center", "-flatten", "-trim", "+repage", "./output-3.png"]);
- process.stdout.write(".");
-
- fs.unlinkSync("./output-2.png");
- fs.unlinkSync("./output.png");
- fs.unlinkSync("./temp.png");
- fs.unlinkSync("./" + index1 + ".png");
- fs.unlinkSync("./canvas.png");
- process.stdout.write(".");
-
- fs.renameSync("./output-3.png", "./output.png");
- process.stdout.write(".");
- }
-
- process.stdout.write("\n");
-}
-
-
-process.stdout.write(".");
-let dimensions = cp.execFileSync("identify", ["-format", "%wx%h", "./output.png"]).toString();
-process.stdout.write(".");
-let highest = Math.max(...dimensions.split("x").map(i => parseInt(i))) + 200;
-cp.execFileSync("convert", ["./output.png", "-background", "none", "-gravity", "Center", "-extent", highest + "x" + highest, "./output-2.png"]);
-process.stdout.write(".");
-cp.execFileSync("magick", ["-size", highest + "x" + highest, "-define", "gradient:direction=North", "gradient:#6acc28-#72ace5", "-colorspace", "sRGB", "gradient.png"]);
-process.stdout.write(".");
-cp.execFileSync("convert", ["./gradient.png", "./output-2.png", "-colorspace", "sRGB", "-flatten", "./output.png"]);
-process.stdout.write(".");
-fs.unlinkSync("gradient.png");
-fs.unlinkSync("output-2.png");
-process.stdout.write(".");
-child_process.execFileSync("signal-cli", [ "-a", number, "updateGroup", "--group", "Im1iOlG3TxtiwAad+aVPJ6RsdSN3YCQauz1SmYiMqA8=", "--avatar", __dirname + "/output.png" ]);
-process.stdout.write(".");
-child_process.execFileSync("signal-cli", [ "-a", number, "sendSyncRequest" ]);
-process.stdout.write(".");
-
-console.log("\nComplete!"); \ No newline at end of file
diff --git a/includes/external/photo/output.png b/includes/external/photo/output.png
deleted file mode 100644
index 81e14c9..0000000
--- a/includes/external/photo/output.png
+++ /dev/null
Binary files differ
diff --git a/includes/external/photo/run.sh b/includes/external/photo/run.sh
deleted file mode 100644
index 19c9c11..0000000
--- a/includes/external/photo/run.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/bash
-rm *.png
-nice -n 19 node index.js \ No newline at end of file
diff --git a/includes/external/photo/temp.png b/includes/external/photo/temp.png
deleted file mode 100644
index ece0ab8..0000000
--- a/includes/external/photo/temp.png
+++ /dev/null
Binary files differ