Found your problem which I had too when I did my first GD script the last line is incorrect as it has an unsigned variable within the function.
imagepng($image_e,'aa.png',0);
So replace the above with below
imagepng($image_p,'aa.png',0);
Notice the letter 'e' in the first box and the letter 'p' in the second box (after the word image). That is your bug. Although your script shows the letter 'e', it needs to be replaced with the letter 'p'. So the overall code will be:
// The file
$filename = 'd.png';
$percent = 0.5;
// Content type
// Get new dimensions
list($width, $height) = getimagesize($filename);
$new_width = 400;
$new_height = 400;
// Resample
$image_p = imagecreatetruecolor($new_width, $new_height);
$image = imagecreatefrompng($filename);
imagealphablending($im_dest, false);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
imagesavealpha($image_p, true);
// Output
imagepng($image_p,'aa.png',0); //this is the line that has been changed
Reputation Points: 410
Solved Threads: 258
Occupation: Genius
Offline 3,004 posts
since Sep 2007