Jump to content

Archived

This topic is now archived and is closed to further replies.

pvtpyro

imagecreate

Recommended Posts

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?

Share this post


Link to post
Share on other sites
[code]<?php
imagecreate ($x, $y);

  // image code


imagegif($im, $path_filename);  // output to file
imagedestroy($im);
?>[/code]

Share this post


Link to post
Share on other sites
[quote author=Barand link=topic=106183.msg424489#msg424489 date=1156920191]
[code]<?php
imagecreate ($x, $y);

  // image code


imagegif($im, $path_filename);  // output to file
imagedestroy($im);
?>[/code]
[/quote]

using imagecreate can create a poor quality image
$image_p = imagecreatetruecolor($new_width, $new_height);

then
imagegif($image_p, $save_to, 75) //75 being the quality, i think 75 is a nice on
or
imagejpeg
or
imagepeng


Share this post


Link to post
Share on other sites
When you say create image, do u mean using other images, or adding lines ect

if 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]


Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.