Jump to content

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


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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.