Jump to content

saving php generated images (Firefox saves as php document instead of .png)


tryingtolearn

Recommended Posts

No idea if this is a problem with my code or a browser issue

I apologize if this is not the correct place to ask.

 

 

I have a page that is merging two images

On the resulting page I would like to right click and then save the image

 

Works fine in IE but in Firefox the only option to save as for file type is PHP Document.

 

The file that merges the images is

<?php
$png = imagecreatetruecolor($width, $height);
$dart_img = "dartgif.gif";
$image3_id = imageCreateFromGIF($dart_img);
imagecopyresized($png, $image3_id, 0, 0, -$x, -$y, $width, $height, $width, $height);
imagesavealpha($png, true);
$trans_colour = imagecolorallocatealpha($png, 255, 255, 255, 127);
imagefill($png, 0, 0, $trans_colour);
header("Content-type: image/png");
imagepng($png);
imagedestroy($png);
?>

 

I am calling the image using

 

echo "<img src=\"img_process.php?width=$width&height=$height&x=$x&y=$y\">";

 

Any ideas on how to get it to save as an image in Firefox

Archived

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

×
×
  • Create New...

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.