hi all
i problem rotate image (png)
code :

$myimage=imagecreatefromjpeg('test.jpg');
$mypng=imagecreatefrompng('opera.png');
$sizepng= getimagesize('opera.png');

$jpgwidth=imagesx($myimage);
$jpghieght=imagesy($myimage);
$pngwidth=imagesx($mypng);
$pnghieght=imagesy($mypng);
$pngwidth1=$sizepng[0] / 10;
$pnghieght1=$sizepng[1] / 10;

imagerotate(mypng,50,1);
imagecopyresized($myimage,$mypng,0,0,0,0,$pngwidth1,$pnghieght1,$sizepng[0],$sizepng[1]);
header("Contents-type: image/jpeg");
imagejpeg($myimage);
imagedestroy($myimage);
imagedestroy ($mypng);
Member Avatar for Rhyan

....

imagerotate(mypng,50,1);
imagecopyresized($myimage,$mypng,0,0,0,0,$pngwidth1,$pnghieght1,$sizepng[0],$sizepng[1]);
header("Contents-type: image/jpeg");
imagejpeg($myimage);
imagedestroy($myimage);
imagedestroy ($mypng);

You are trying to create a JPG from PNG. I don't think that GD allows this. Therefore you should use createimagefrompng() and imagecopyresampled(). Also, header(content....) should be PNG, not JPG.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.