'; $poster = $_GET['poster']; $kill = $_GET['kill']; if ($poster) { echo '
' . $poster . ' kill'; exit; } if ($kill) { rename($kill, substr($kill, 0, 27) . '_' . substr($kill, 27)); echo $kill . ' killed.'; exit; } $path = 'posters/wikipedia.org'; $list = crawlPath($path); foreach ($list as $value) { if (strstr($value, '/_')) $signature[$value] = md5(file_get_contents($value)); else if (strstr($value, '_')) unlink($value); } echo (count($list) - count($signature)) . ' posters

'; sort($list); foreach ($list as $value) { if (!$signature[$value]) { if (in_array(md5(file_get_contents($value)), $signature)) { rename($value, substr($value, 0, 27) . '_' . substr($value, 27)); // echo '
'; } else { $pathinfo = pathinfo($value); $extension = $pathinfo['extension']; $imagesize = getimagesize($value); if ($extension == 'png' || $imagesize[0] >= $imagesize[1]) echo '
' . $value . ' kill

'; } } } ?>