pvtpyro Posted August 30, 2006 Share Posted August 30, 2006 I made a script that creates an image. It makes the image just the way I want. comes out perfectly! but the [b]imagedestroy($image);[/b] prevents me from being able to save the image. As of now the file saves as a filename.php.gif, but it's not actually a gif.is there a function or something I can use to save the actual image on my server, then show it in the browser for people to see? Quote Link to comment Share on other sites More sharing options...
Barand Posted August 30, 2006 Share Posted August 30, 2006 [code]<?phpimagecreate ($x, $y); // image codeimagegif($im, $path_filename); // output to fileimagedestroy($im);?>[/code] Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 30, 2006 Share Posted August 30, 2006 [quote author=Barand link=topic=106183.msg424489#msg424489 date=1156920191][code]<?phpimagecreate ($x, $y); // image codeimagegif($im, $path_filename); // output to fileimagedestroy($im);?>[/code][/quote]using imagecreate can create a poor quality image$image_p = imagecreatetruecolor($new_width, $new_height);thenimagegif($image_p, $save_to, 75) //75 being the quality, i think 75 is a nice onorimagejpegor imagepeng Quote Link to comment Share on other sites More sharing options...
pvtpyro Posted August 30, 2006 Author Share Posted August 30, 2006 thank you so much! :D Quote Link to comment Share on other sites More sharing options...
pvtpyro Posted August 30, 2006 Author Share Posted August 30, 2006 once i add imagename.gif after $image, the script stops working. ??? Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 30, 2006 Share Posted August 30, 2006 When you say create image, do u mean using other images, or adding lines ectif using other images, here is code I use to blend images[code]<?php$myimage = imagecreatefromjpeg("images/bground_img.jpg");imagealphablending($map, 1);$extra_img = imagecreatefromjpeg("second_img.jpg");imagealphablending($extra_img, 1);imagecopy($myimage, $extra_img, $x_loc, $y_loc, 0, 0, $width, $height);imagejpeg($map, $save_to);?>[/code] Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.