70) { $errors[] = "0x{$_}000002A: Image #" . $_ . " is wider than it should, are you sure you set zoom to 1x? Maybe you inverted the files?"; } if ($_ === 1 && $size[1] > 70) { $errors[] = "0x{$_}000002B: Image #" . $_ . " is higher than it should, are you sure you set zoom to 1x? Maybe you inverted the files?"; } if ($_ === 2 && $size[0] > 35) { $errors[] = "0x{$_}000002A: Image #" . $_ . " is wider than it should, are you sure you set zoom to 1x? Maybe you inverted the files?"; } if ($_ === 2 && $size[1] > 35) { $errors[] = "0x{$_}000002B: Image #" . $_ . " is higher than it should, are you sure you set zoom to 1x? Maybe you inverted the files?"; } } if (count($errors) === 0 && isset($_GET["real"])) { foreach ([1, 2] as $_) { $input = $json_object[$_ - 1]; $mime = explode(";", substr($input, 5))[0]; $file = base64_decode(explode(",", explode(";", substr($input, 5))[1])[1]); $image = @imagecreatefromstring($file); imagealphablending($image, false); imagesavealpha($image, true); if ($_ === 1) { imagepng($image, $_SERVER['DOCUMENT_ROOT'] . "/assets/ponies/" . $member["id"] . ".png"); } else { imagepng($image, $_SERVER['DOCUMENT_ROOT'] . "/assets/uploads/pt-" . $member["name"] . ".png"); } } } die(json_encode([ "success" => count($errors) === 0, "errors" => $errors ]));