I have searched the web and found many treads on this one, but i can not find a solution for my issue.
I'm able to upload jpg and jpeg files, but when uploading png files, they turn out black.
This is my code for uploading the png files:
$dest_image = imagecreatetruecolor($width, $height);
if($image_extension == ".png"){
$source_image = imagecreatefrompng($temp_png_file);
imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, $width, $height, $width, $height);
imagepng($dest_image, $folder.$new_name);
}
Thanks