summaryrefslogtreecommitdiff
path: root/includes/refresh.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/refresh.php')
-rw-r--r--includes/refresh.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/includes/refresh.php b/includes/refresh.php
index ff8d1eb..fefebb2 100644
--- a/includes/refresh.php
+++ b/includes/refresh.php
@@ -41,6 +41,8 @@ foreach ($deletable as $item) {
}
$times["docs_cleanup"] = microtime(true) - $currentOpStart;
+require_once "./cleanup.inc";
+
$currentOpStart = microtime(true);
$version = json_decode(file_get_contents($_SERVER['DOCUMENT_ROOT'] . "/includes/data/version.json"), true);
@@ -193,7 +195,9 @@ foreach (json_decode(file_get_contents("./data/gdapd/members.json"), true) as $m
if (isset($member['avatar_url'])) {
echo(" Profile picture\n");
- exec("convert -resize 128x128 -quality 50 \"" . $member['avatar_url'] . "\" \"./data/images/pf-gdapd-" . $member['id'] . ".webp\"");
+ file_put_contents("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION), file_get_contents($member['avatar_url']));
+ exec("convert -resize 128x128 -quality 50 \"" . "/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION) . "\" \"./data/images/pf-gdapd-" . $member['id'] . ".webp\"");
+ unlink("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION));
}
echo(" Pony Town character\n");
@@ -211,7 +215,9 @@ foreach (json_decode(file_get_contents("./data/ynmuc/members.json"), true) as $m
if (isset($member['avatar_url'])) {
echo(" Profile picture\n");
- exec("convert -resize 128x128 -quality 50 \"" . $member['avatar_url'] . "\" \"./data/images/pf-ynmuc-" . $member['id'] . ".webp\"");
+ file_put_contents("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION), file_get_contents($member['avatar_url']));
+ exec("convert -resize 128x128 -quality 50 \"" . "/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION) . "\" \"./data/images/pf-ynmuc-" . $member['id'] . ".webp\"");
+ unlink("/tmp/img." . pathinfo($member['avatar_url'], PATHINFO_EXTENSION));
}
echo(" Pony Town character\n");