JPG 파일은 업로드 할 수 있지만 PNG 파일은 업로드 할 수 없습니다.
PNG 이미지는 저장되지 않습니다,하지만 ‰PNG À À°£ûïS JÄž Ÿ¬™Ù<íû;
업로드 된 PNG 파일을 저장할 수 없습니다.
내 코드으로 출력한다 이런 식입니다 : 내가 잘못 뭐하는 거지
$source_gd_image = imagecreatefrompng($sourcefile); // <-- If PNG file
$target_gd_image = imagecreatetruecolor($target_image_width, $target_image_height);
if($source_image_type == IMAGETYPE_PNG) {
imagealphablending($target_gd_image, true); // Should this be false?
imagesavealpha($target_gd_image, true);
imagepng($target_gd_image); // <-- This is where the gibberish is outputed
}
if($source_image_type == IMAGETYPE_JPEG) {
imagecopyresampled($target_gd_image, $source_gd_image, 0, 0, 0, 0, $target_image_width, $target_image_height, $source_image_width, $source_image_height);
imagejpeg($target_gd_image, $target_file, $quality);
}
imagedestroy($source_gd_image);
imagedestroy($target_gd_image);
?
시도 추가 헤더'('영상/PNG 콘텐츠 유형')의 $ TARGET_FILE 가정
수단을 사용하여 원하는 출력 파일의 이름이다. – bfavaretto