d.shankar Posted August 6, 2008 Share Posted August 6, 2008 Hello all this may sound a bit tricky. but u guys can sort it off I have generated a php gd image and added some text to it. Till here its fine... Now i need to save that image with the text created using gd automatically to the directory how to do that ??? Link to comment https://forums.phpfreaks.com/topic/118450-solved-image-save-help/ Share on other sites More sharing options...
DarkWater Posted August 6, 2008 Share Posted August 6, 2008 Use the second parameter of imagejpeg(), imagepng(), or whichever function you use to output your image in order to save it instead. Link to comment https://forums.phpfreaks.com/topic/118450-solved-image-save-help/#findComment-609746 Share on other sites More sharing options...
d.shankar Posted August 6, 2008 Author Share Posted August 6, 2008 No dude.. my code is working fine .. i do use imagepng(). see below <?php $image_path="image.PNG"; $font="arial.ttf"; $string="text over image"; $im = imagecreatefrompng($image_path); $colorwhite = imagecolorallocate($im, 255, 255, 255); imagettftext($im, 6.5, 0, 11,63, $colorwhite, $font,$string); imagepng($im); imagedestroy($im); ?> Now i need to save the image in that very same directory automatically ! Link to comment https://forums.phpfreaks.com/topic/118450-solved-image-save-help/#findComment-609868 Share on other sites More sharing options...
DarkWater Posted August 6, 2008 Share Posted August 6, 2008 Okay...imagepng() takes a second parameter, the pathname of the file in which you want it saved. Read the manual page on imagepng(). >_> Link to comment https://forums.phpfreaks.com/topic/118450-solved-image-save-help/#findComment-609872 Share on other sites More sharing options...
PFMaBiSmAd Posted August 6, 2008 Share Posted August 6, 2008 The only way to use php effectively and get it to do what you want, is to read the php manual section for the function(s) you are attempting to use. Link to comment https://forums.phpfreaks.com/topic/118450-solved-image-save-help/#findComment-609876 Share on other sites More sharing options...
DarkWater Posted August 6, 2008 Share Posted August 6, 2008 The manual is the best PHP tutorial you could ask for. Link to comment https://forums.phpfreaks.com/topic/118450-solved-image-save-help/#findComment-609878 Share on other sites More sharing options...
d.shankar Posted August 6, 2008 Author Share Posted August 6, 2008 Manuals are for PHP Experts. PHPfreaks is fo n00bs like me. So from every post i learn new things everyday. Link to comment https://forums.phpfreaks.com/topic/118450-solved-image-save-help/#findComment-609914 Share on other sites More sharing options...
Jabop Posted August 6, 2008 Share Posted August 6, 2008 Manuals are for PHP Experts. PHPfreaks is fo n00bs like me. So from every post i learn new things everyday. Manuals are for people seeking information... PHP freaks is for people seeking information. Most find their answers from the manual first. Link to comment https://forums.phpfreaks.com/topic/118450-solved-image-save-help/#findComment-609919 Share on other sites More sharing options...
d.shankar Posted August 6, 2008 Author Share Posted August 6, 2008 Ok ok ok Link to comment https://forums.phpfreaks.com/topic/118450-solved-image-save-help/#findComment-609921 Share on other sites More sharing options...
PFMaBiSmAd Posted August 6, 2008 Share Posted August 6, 2008 Manuals are for PHP Experts.That is incorrect. When learning anything, finding out the basics of what you are doing will always help you do that thing easier, better, faster, and safer. Would you attempt mountain climbing without first learning how? Using any function, such as imagepng(), easier, better, faster, and safer, means learning what that function does, what parameters it accepts, and what it returns, that is what a programming language reference manual is for. Link to comment https://forums.phpfreaks.com/topic/118450-solved-image-save-help/#findComment-609929 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.