The following code fetches a skin and crops it, however as the result is tiny I wish to re-size it. I have tried imagecopy, imagecopyresize but decided to use imagecopyresampled as it apparently makes the final look nicer :).
Sadly NONE of these functions work and instead give me a black 128X128 square! Any ideas?
<?php
$image = imagecreatefrompng('http://s3.amazonaws.com/MinecraftSkins/bbqr0ast.png');
$crop = imagecreatetruecolor(128,128);
$userImage = imagecopyresampled($crop, $image, 0, 0, 0, 0, 128, 128, 8, 8);
header('Content-type: image/png');
imagepng($crop);
?>
Edited by bbqroast, 06 July 2011 - 11:31 PM.


Sign In
Create Account


Back to top










