Hey,
For my website, I made a multifile uploader.
It works like a charm, but today I wanted to add a new feature to it. This feature will allow you to upload the image AND place a small logo in the downleft corner.
Ok, doesn't seem too difficult, and I succeeded in getting it to work.
But there is one small problem:
When I add the logo to the original image and save it again, the colors get screwed up.
The imagesize (kb, not dimensions) is also a bit higher.
This is the ORIGINAL logo that has to be placed over the iamge:
http://www.game-trix.com/screens/hoverlogo.jpg
And here's the endresult:
http://www.game-trix.com/screens/test/ut.jpg
And this is the code I use for making the image (just part of it, only the logomaker):
if($insertlogo=="yes")
{
$imagename[$c]="http://www.game-trix.com/screens/$dir/$name"; // the big image
$logo="http://www.game-trix.com/screens/hoverlogo.jpg"; // the logo that goes over it
$src_img=imagecreatefromjpeg($imagename[$c]); // create the original pic
$dst_img=imagecreatefromjpeg($logo); // create the logo
$image_stats=getimagesize($imagename[$c]); // needed for the positioning of the logo on the big image
$imagewidth=$image_stats[0];
$imageheight=$image_stats[1];
$vert=$imageheight-67; // height of logo is 62, and i want it to be placed 5 px above the bottom
imagecopyresized($src_img,$dst_img,5,$vert,0,0,126,62,imagesx($dst_img),imagesy($dst_img)); // copy all the stuff
imagejpeg($src_img,"../screens/$dir/$name",85); // and create the image. Already made the quality 85, but it's still bigger than the original.
}
What am I doing wrong? 🙂