Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * IDK Script by Steve Winfield
- * Cuts off the head of a habbo avatar
- **/
- header('Content-Type: image/png');
- if (!isset($_GET['figure']))
- $_GET['figure'] = 'hr-165-45.hd-208-2.ch-250-64.lg-285-82.sh-290-64,s-0.g-0.d-4.h-4.a-0';
- $params = '';
- foreach($_GET as $k => $v)
- $params .= '&'.$k.'='.$v;
- $hashcheck = md5('avatar_'.$params);
- if (file_exists('./cache/'.$hashcheck.'.png'))
- exit(file_get_contents('./cache/'.$hashcheck.'.png'));
- $faceline = array(
- 50 => array(54, 0),
- 49 => array(54, 0),
- 48 => array(28, 33),
- 47 => array(26, 35),
- 46 => array(25, 36),
- 45 => array(24, 37),
- 44 => array(23, 54),
- 43 => array(22, 54)
- );
- $source = imagecreatefrompng('http://www.habbo.de/habbo-imaging/avatarimage?'.substr($params, 1));
- $img = imagecreate(54, 65);
- $trans = imagecolortransparent($img, imagecolorallocate($img, 0, 0, 0));
- imagecopy($img, $source, 0, 0, 6, 8, 54, 51);
- for ($x = 0; $x < 54; $x++) {
- for ($y = 0; $y < 65; $y++) {
- if (isset($faceline[$y]) && ($x < $faceline[$y][0] || $x > $faceline[$y][1]))
- imagesetpixel($img, $x, $y, $trans);
- }
- }
- ob_start();
- imagepng($img);
- file_put_contents('./cache/'.$hashcheck.'.png', ob_get_contents());
- imagedestroy($img);
- imagedestroy($source);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement