success) { // OK } else { echo "reCAPTHCA verification failed, please try again."; exit(0); } error_reporting(E_ALL); ini_set("display_errors", "On"); $uploaded = []; $paths = []; function randnumb($length = 3) { return substr(str_shuffle(str_repeat($x="0123456789", ceil($length/strlen($x)) )),1,$length); } $ok = true; $num_images = 1; $images = []; for ($i = 1; $i <= 4; $i++) { $error = $_FILES["image_" . $i]['error']; if($error == UPLOAD_ERR_OK) { array_push($images, $_FILES["image_" . $i]); } } if(count($images) == 0) { echo "No image was provided."; $ok = false; } if(count($images) > 4) { echo "Too many images were provided."; $ok = false; } for ($i = 0; $i < count($images); $i++) { if($images[$i]["size"] > 9999999) { echo "File is too large."; $ok = false; } } if($ok) { $fstring = ""; $start = true; for ($i = 0; $i < count($images); $i++) { $fname = basename($images[$i]["name"]); $ext = substr($fname, strrpos($fname, '.') + 1); $fname2 = time() . "_" . randnumb() . "_" . $i . "." . $ext; $target = "uploads/" . $fname2; global $uploaded; if(move_uploaded_file($images[$i]["tmp_name"], $target)) { array_push($uploaded, $target); $fstring = trim($fstring . " " . $target); } else { echo "There was an error uploading the image(s)."; $start = false; break; } } if($start) { process($fstring); } } function process($filestring) { $modes = []; $num_effects = 8; $delay = 0.25; for ($i = 1; $i <= $num_effects; $i++) { if(isset($_POST["effect_" . $i])) { array_push($modes, $i); } } if(count($modes) == 0) { echo "No effects selected."; exit(0); } $modestring = implode(",", $modes); if(isset($_POST["delay"])) { $delay = $_POST["delay"]; } $date1 = microtime(true); try { $cmd = "rust/target/release/mutant " . $modestring . " " . $delay . " " . $filestring; } catch (Exception $e) { cleanup(); exit(0); } global $paths; $paths = explode(" ", exec($cmd)); $date2 = microtime(true); $style = "body, html { background-color: black; color: white; font-family: sans-serif; font-size: 18px; } .item { display: inline-block; padding: 20px; } .title { padding-bottom: 5px; display: block; } .info { margin-left: 20px; margin-right: 20px; margin-top: 20px; margin-bottom: 15px; padding: 5px; background-color: #32343d }"; $topheader = "