tryingtolearn Posted March 8, 2008 Share Posted March 8, 2008 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 Quote Link to comment https://forums.phpfreaks.com/topic/95057-saving-php-generated-images-firefox-saves-as-php-document-instead-of-png/ Share on other sites More sharing options...
Barand Posted March 8, 2008 Share Posted March 8, 2008 to save a gd generated image specify the filename in imagepng() imagepng($png, 'myimage.png'); This is done on the server - so no browser involved. Quote Link to comment https://forums.phpfreaks.com/topic/95057-saving-php-generated-images-firefox-saves-as-php-document-instead-of-png/#findComment-486904 Share on other sites More sharing options...
tryingtolearn Posted March 8, 2008 Author Share Posted March 8, 2008 Thanks Barand Worked great You are always so helpful when I post here. Quote Link to comment https://forums.phpfreaks.com/topic/95057-saving-php-generated-images-firefox-saves-as-php-document-instead-of-png/#findComment-486930 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.