Saving A Php Generated Image To The Server - Help Needed Please

free web hosting
Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

Saving A Php Generated Image To The Server - Help Needed Please

vujsa
I'm trying to create a script that will generate an image and send it back to the browser while saving the same image to the server. I'm doing this because the image should be dynamically generated but because of the load that would place on a server if the image happened to be requested frequently, I've decided to build in a means to serve the static version of the image most of the time.
What isn't included here is the function that will check the age of the file in cache directory and serve the static image if it is less than an hour old. This isn't really needed to get this part of the script working so to prevent making the code more complicated, I left it out. I'm having trouble saving the generated image to the server. I have finally gotten it to save the file but it is saving the data as text and not as a PNG image file.

Here is the script as it is currently written:
CODE
<?php
// Designate a background image
 $background = imagecreatefrompng("background001.png");

// Designate a foreground image
 $insert = imagecreatefrompng("token001.png");

// Select the origin pixel of the foregrounf image as the transparent color
 imagecolortransparent($insert,imagecolorat($insert,0,0));

// Get dimisions of the foreground image
 $insert_x = imagesx($insert);
 $insert_y = imagesy($insert);

// Place the foreground image on the background image
 imagecopymerge($background,$insert,345,72,0,0,$insert_x,$insert_y,100);

// Insert Text into the image
 $text = $_GET['action'];
 $red =  imagecolorallocate($background, 255, 0, 0);
 $font = "verdana.ttf";
 imagettftext($background, 14, 0, 238, 90, $red, $font, $text);
 imagettftext($background, 8, 0, 238, 125, $red, $font, mktime());

// Start the content buffer to hold information prior to saving
 ob_start();

// Set the header information of the image
 header ("Content-type: image/png");
 header('Content-transfer-encoding: binary');

// Output a png image
 imagepng($background,'',100);

//Assign a variable to hold the buffer information and clear/close buffer
 $output = ob_get_clean();

// Clear computer memory of image data
 imagedestroy($background);

// Output the buffer information to browser
 echo $output;

// Open or create a file and write buffer information to it.
 $cachefile = "cache/test001.png";
 $handle = fopen($cachefile, "w+b");
 fwrite($handle, $output);

// Close file
 fclose($handle);

?>


Here is the output shown of test001.png:
CODE
PNG



IHDR
$!,.¢ BR}E[Uk[J֥o ZbEE
ٳB2 Yf23ǝs h'9<s= [` cÉV` cƐe/q01
K1} c 1;01@fv#1a cǰ_
1PEE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Y5OCa0sG^
~0MeZ#P4YʜXxWa86v=m\&z}*z}Va#A=KZZ!S+LppO^6h H-=퓡
lPHl 9Hӥ ٣ %yn.hV}X S%V弴~:-'%a)p
DҙYȤ32kUg`[
,;W*2C5({_7j?z2{Dz4XR6+FtU{MBŋq76>R1ި'MuVVр.}2hʌ =ѐZ`X©@ha*oQ-2dtIh؜֊JV-]
/|2\9n@"F 6Xu8
AU|H)*gZ!) J]$eԎcTsOIN/ 
l+Ql˳3Ru)%1;Ӣ5(ƳՄ =Y}MB~&GD'j35TT+G
xv׳x$*B|IFa,!ك ߣb|VO ݃żV<;VVxR:G{ /ȴ[Ӝn"SAPď4KJ~3)5iXkc!xxƎ%YT(<8=@c:Jrg&yao+9oh$Y=Av%e*Q3ptIYl*;.VYzrxM p0!Fn$h+Xf4N)^ɯcDi31>.=i$i]
msN9j HV~n'D!'*OҨO(= Ev9BqKXl0!D盚8O Ml ș@֢ud˫5+T2as3GXrr #-HL ?P@$j
u:[0C!O{:.1*ma㑗c I1&~g .YP`k$2
" qhZh&Qg,eQQ#_Hr|()U#&=X^7, g2LA<Ռ{C(HWsfT9 j\&]sjdI(!hP/cgH'F97ARtl^L朏}C,{:r?{mFPWEq)VLLT'o?2t83M:9!̹rqleT\Y_}y<0OKr 5ա
Gf7*VRT{И tԃM/FtR` B[͊Gz#QӇh4!ubKb$n
i EsaDn݀'&{k}3k7
^ǔWr`
8W|i"D!OP-C D!"ęCf"D3r=D!$D d!B8kc+



Anyone know how to successfully generate and save an image file using PHP?

Thanks for any help you can give. cool.gif

vujsa

 

 

 


Reply

mastercomputers
Hey vujsa,

Simple error, this line:

$handle = fopen($cachefile, "w+b");

Should be:

$handle = fopen($cachefile, 'wb');

That should be it.

Other than that, I would probably have to test it out myself.


Cheers,


MC

Reply

vujsa
Well, that didn't fix the bug. I'm still getting trash instead of the image.

Any ideas?

vujsa


Reply

vizskywalker
Instead of using fwrite() to create the png, you need t use imagepng as what you are actually saving is an image resource, not the png image. Simply use this format: imagepng($image, $filename) where $image is the png image resource and $filename is the name of the file you want to save it to.

~Viz

Reply

vujsa
Okay everyone, false alarm.

The problem wasn't in the code but instead was in a .htaccess two directories above the image to be shown. I forgot to delete the .htaccess that redirected .png file extensions to the PHP engine after I replaced that set up. I now use a diferent means to mask urls.

Everything is working fine now with out the need to use any file system functions ot object buffering.

Basically, to print to file use:
imagepng($image, 'path/to/file.png');

and to print to browser use:
imagepng($image, '');

hope this helps everyone.

vujsa

Reply

vizskywalker
That's what I said vujsa! Glad it's working now. If anymore problems arise just post back here.

~Viz

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Similar Topics

Keywords : saving, php, generated, image, server, needed

  1. View Php In Another Server
    (4)
  2. Dynamic Php Image And Better Php Code Question
    (10)
    Im working on a dynamic image, can i put 2 images in same dynamic image, and can i make this code
    shorter? if ( $goal == 31 ) { $xp2 = ('14833'); } elseif ( $goal == 32 ) { $xp2 =
    ('16456'); } elseif ( $goal == 33 ) { $xp2 = ('18247'); } elseif ( $goal == 34 ) {
    $xp2 = ('20224'); } elseif ( $goal == 35 ) { $xp2 = ('22406'); } elseif ( $goal ==
    36 ) { $xp2 = ('24815'); } elseif ( $goal == 37 ) { $xp2 = ('27473'); } elseif (
    $goal == 38 ) { $xp2 = ('30408'); } elseif ( $goal == 39 ) { $xp2 = ('33648')....
  3. Dynamic Gd Image
    (2)
    I dont know if someone already made a topic like this, however it's not hard to understand if
    you can php, as many know we need to start a php script with CODE and end with CODE ?>
    to make a image you need a image type, I choos .png because its much cleaner then .jpg CODE
    header("Content-type: image/png"); for the background for the image we need this code CODE
    $image = imagecreatefrompng("http://www.imagefilez.com/out.php/i252132_Userbar.png"); if we wont
    a text in the image we need a font color, we get our font color from HEX values ....
  4. Image Popup On Mouseover
    (23)
    I need a script that does this: Lets say I have form with options...you surely know what that is...
    CODE Who do you wanna race? Derbi Senda 50 Honda NS 50 R Suzuki ZR
    50 Yamaha DT 50 MX Aprilia RS 50 - ? When i put my mouse over
    one of them i want a picture of bike on which your mouse is on to pop up... I hope you understand
    what i mean...i can't rephrase it to be more meaningful...i tried /wink.gif"
    style="vertical-align:middle" emoid=";)" border="0" alt="wink.gif" />....
  5. Need Help With Background Image...
    (12)
    I want to add background image to all sites on my website but some include "foot.php" and "head.php"
    and some "footer.php" and "header.php" but all include "config.php" but i dont know in which should
    i put it....any help??....
  6. Coders Needed To Help On A Bulletin Board System (BBS)
    php, mySql, Graphics design work, etc (4)
    I recently got involved in a Forum software script which is being developed and thought I should let
    everyone know that they need some assistance in the PHP, MySql, Html, and CSS areas. Also, some
    Visual Designers would be quite useful. AEF Forum Software is the name of the project. It is
    presently in version 1.0.3, and have some pretty cool features already, but in order to advance in
    its standings against such Boards as IPB, phpbb, Yabb, etc, more features and Themes are required.
    Good bunch of people working hard, but just not enough of us to do everything. Come h....
  7. Using Php With A Mail Server
    (2)
    We all know you can use PHP with a web server, but can you use it with a mail server? I've made
    a personal messenger system, and I was thinking about adding additional functionality in the future,
    such as the ability to send mail from it. Then I started thinking, would it be possible to recieve
    mail with it? Say, have a PHP script that checked when a message arrived at the server, and when it
    does, check for something in the message (e.g. "pmsystem-to: admin") that would tell it to send it
    to a certain user, and then have it do the scripts to send a PM. So, is it....
  8. Basics Of Php For Beginners - Suggestion
    Help Needed For Project (5)
    Hi all, I have a friend who, for his extended IT project is interested in making a website partly
    out of php. When he asked for advice my first thought was here. I would like to know some good
    websites, tutorials etc that he can use to introduce himself to php (he hasn't done much
    before). He is interested in making a simple login/subscription service where you can signup and
    then login to a 'members only' page. Any ideas and code samples that you have to share would
    be greatly appreciated. /tongue.gif" style="vertical-align:middle" emoid=":P" border="0" a....
  9. Php :: Image Pixel Per Inch And Conversion
    Please Guide (1)
    Hi Masters I want soemone to let me know (maybe through a good tutorial and/or PHP Sample Code)
    the following : 1 - User will only allowed to upload images with minimum 120 and maximum 300 Pixel
    Per Inches 2 - User will only allowed to upload JPG images, however, if Gif / BMB / PNG / ETC is
    uploaded the script will convert that into jpg. 3 - If the Image's PPI is > 300 it will set
    to 300. Please guide . I know this can'y be done by GD it requires ImageMagick, Pleae help
    !!!!!!! ....
  10. Image Works With Php And Gd
    (3)
    Hi I have a 1 Big map. What i want is that the user will enter the latitude and longitude. the
    script will show that location in the image. I know how to convert Image X,Y Coordinates into
    Latitide and Longitude and vise versa. But there point is that the image is 1000x1000 wide but i
    want to show only the particular region of that latitude / longitude in 300x300 image. means that
    the PHP script will CROP wht Image (1000x1000) to 300x300. That way, the script will be shoing the
    part of an image, not the whole image. please help !!....
  11. Php :: Adding Image Over Image
    (5)
    Hi Masters & Champions. I want some help regarding putting and image over some location (x pixel ,
    y pixel) of an image. Here it is quite important to note that the mage which is Inserted over an
    image must be clickable. Like for example suppose i put T on an image DD then the T must be
    clickable. Please gudie as this is quite important for me . Thanks ....
  12. Script For Viewing A Random Image Needed
    (3)
    While browsing the web, I bumped into a script that I could really use, since it's different
    from everything that I saw. Most scripts that view a random image contain a code that chooses an
    image, and then puts the part into the page itself. However, on the www.greenplastic.com web
    site (dedicated to Radiohead), in the top left corner there is a random image module. If you look at
    the code, here's what is used: CODE Now, how can a PHP script be an image, and what
    kind of script that is? If you do visit that URL , you don't get a normal page, b....
  13. User Authentication Session Handling Problems
    Authorization server variables not staying across pages (14)
    This is quite a bit of problem I am facing, and I cannot point exactly where I am going wrong. I
    have been lurking around here at the Asta Host forums with regard to login and user authentication
    scripts and I have got as far as this: - Starting a session - Registering a session variable -
    Using the variable to check if the user is authenticated or not. - Authenticating the user through
    MySQL database - Logging of the user, by setting the session variable to un-authenticated I have
    been able to achive the following things too that I think is not related to this proble....
  14. How To Reset The Server Variable Php_auth_user
    (9)
    Hi, i'm developing a web application which obviously requires a log in/log out script that i
    just implementing but i dont know why the log out script dont work fine. The problem is related
    with the server variable $_SERVER which remains set even when in the log out script i unset it with
    the unset() function. Does someone knows how can i reset or clear the server variable $_SERVER ???
    Best regards, ....
  15. How Do I Resize An Image On The Fly?
    (8)
    I was wondering how I would go about resizing an image from a databse without saving it to a file.
    CODE include("settings.inc.php"); $get_a=$_GET ; $get_b=$_GET ; $get_width=$_GET ;
    $get_height=$_GET ; $query="SELECT * FROM $get_a WHERE id='$get_b'";
    $result=mysql_query($query); $image=mysql_result($result,0,"coverimg");
    $size=mysql_result($result,0,"imagesize"); $type=mysql_result($result,0,"imagetype");
    header("Content-length: $size"); header("Content-type: $type"); echo $image; ?> Obviously the
    image I want to resize is $image. The page name....
  16. Viper Guestbook
    Needed urgently (5)
    Hey all, I need Viper GuestBook, which is a free PHP Script ... When I try to download from
    Hotscript Com it refers me to its website : http://www.vipergb.de.vu/ But the website is
    actually hosted on Lycos, and has been Downtime (Offline) since over 2 months .. I cannot access
    this script /sad.gif" style="vertical-align:middle" emoid=":(" border="0" alt="sad.gif" /> If
    somebody, have access to tis website, and can download the script, than please give me. Or
    otherwise, if u have download the script before (the site getting offline), than please send it to
    me ......
  17. Uploading Image Via Admin Menu?
    (2)
    There's never much action in here. Here's a question for all you php guys out there.
    Here's what I want. Let's say I create a simple administration menu for someone to
    Add/Edit/Delete a record/item from a database. Now in the add function, let's say I want to
    store a URL to a image. Rather than having to go in and FTP that image up on the server, how could
    a person create a 'Browse' button and find that image on your harddrive, then create a
    script to upload the image to the server? Just wondering how to do it, or if it could be done e....
  18. How Do I Make PHP Based Image Gallery Like This?
    Help Needed (20)
    is it possible to make a page in php, with a url like this:
    httq://www.mysite.com/viewer.php?http://www.mysite.com/galleries/01 (This is a sample link, read
    below) so that in what i change the last part the gallery will change with it? so that i just have
    to make one php-page and this page just shows all the imaes in the map thats in the url after the
    questionmark?? thanks,....
  19. Is It Possible To Create A String Image In Chinese
    (0)
    CODE Using imageloadfont $im = imagecreate(50, 20); $black = imagecolorallocate($im, 0, 0, 0);
    $white = imagecolorallocate($im, 255, 255, 255); imagefilledrectangle($im, 0, 0, 49, 19, $white);
    $font = imageloadfont("04b.gdf"); imagestring($im, $font, 0, 0, "Hello", $black); imagepng($im); ?>
    This is an example for illustrating how to create a image including a string with a specific
    font. In the codes, a font named "04b.gdf" is loaded and the string is created according to the
    font. What is the font named gdf? I mean what's the limitation or specificatio....
  20. Include Directives And Efficancey
    Server preformance, response time (4)
    Hello there. Most of my programming experiance has been with compiled languages. However, I am now
    working in PHP. In a compiled languages (or even a client-side scripting language), include
    directive only effect the preformance at compile-time. It has always been my style to make all
    global variables, functions, and data structures available to all source files by including a header
    file that would then in turn include all the project's headers in the correct sequence. Now, as
    I have said, I am working in PHP. The design of my page is that of a program, with the ....
  21. Php: Write Random Text As Image
    Having problems, help needed! (3)
    I'm trying to create a script that writes text to an image. CODE header("Content-type:
    image/png"); $_phrases = array( "Test 1", "Test 2", "Test 3", "Test 4", "etc." ); $_rand_phrase
    = $_phrases ; $_image = imagecreatefrompng("gmail.png"); $_user_width =
    imaagettfbbox(9,0,"tahoma.ttf",$_rand_phrase); $_x_value = (200-($user_width + 113)); $_color =
    imagecolorallocate($_image, 165, 164, 164); imagettftext($_image, 9, 0, $_x_value, 16, $_color,
    "tahoma.ttf", $_rand_phrase); imagepng($_image); imagedestroy($_image); I can't see what
    I'm doing wron....
  22. Forum Signature-image With Php
    Use PHP to create an image in real-time (8)
    With interest I have read these Topics. What I want to do with PHP is the following:
    Signatue-image This is the Forum Signature of my cousin, who lives in Europe. The image is
    generated in real-time. (Refresh the page, and see for yourself) My cousin refuses to tell me how
    he did this. But I want to do the same thing, also with PHP. Any ideas? Greetings, John. This
    is NOT a tutorial and in future you should be more careful about where you're posting your
    threads. Moved to Programming > Scripting. ....
  23. Server-friendly Php Scripts
    (5)
    Hi I'm relativly new to php... I'm interested in writing server-friendly php scripts and i
    was wandering in what cases php scripts are harmfull to server i runs on... i was thinking about
    issues like: * Which php functions are expensive from the point of view of server's
    performance and resources? * What is considered to be a long array in php context if ,say, each
    record is 100 bytes long? (100+ element ? a few thousands?) * Are there some assumptions that php
    programmer should avoid? (comes to mind this example: http://il.php.net/register_globals )....
  24. Site Counters - Help Needed
    (13)
    I want a good Site counter(to keep track of visitors) for my site..... can nebody temme.....
    where will i get free stuff on this... (dont ask me to google..and try out..i am doing that..just in
    case u know someplace) OR Can how do i design my own (which seems quite....difficult for me) Plz
    help!! Satya....
  25. Mini Apache Server W/ Php
    Grab it right now ... (5)
    Hi, Those who don't want to go into all the hassle of configuring Apache with PHP - here's
    a quick alternative. Grab MiniApache_PHP from http://213.106.116.50/james/ . It's a much
    downscaled version of the real Apache server but includes the PHP modules too - very little
    headache over installation and you can start hosting your own sites rightaway. Good alternative for
    testing your custom php codes too... This is what the site says about the software: QUOTE
    MiniApache_PHP is a cut-down version of the open-source Apache web server software for Wind....
  26. Help With Some Php Or Maybe Asp
    help needed (5)
    Hi Too all first of all I want to say I need 10 posts badly so lets help each other lol! Ok and now
    the real part I need some help with php because Im pretty new to it (really im not a big fan of php
    I like asp more but as asp is an Microsoft protuct its not cheap so have to start liking PHP
    /laugh.gif' border='0' style='vertical-align:middle' alt='laugh.gif' /> ) I need too include a
    part of one site in my site that meens i dont need the whole site onlia a smal part. I found the way
    but it loads very slow so im trying to find an other way. Heres the code maybe you&....
  27. Random Image / Random Header
    S.O.S. (5)
    im building a website, and i need some help i got 3 frames, navigation, top and main, but i want
    the top banner to have a new tagline with every refresh, just like the header, it dont really matter
    what coding it is, as long as it's not to weird /tongue.gif' border='0'
    style='vertical-align:middle' alt='tongue.gif' /> ....
  28. [PHP]fsockopen(): Timed_out
    fsockopen() on a Irc Server (7)
    I have create a script that open a connection on a irc server like a BnC; when i test it on my local
    machine it's all ok, but here i receive every time Timed_out, and i don't know why, Someone
    can me explaine why? /sad.gif' border='0' style='vertical-align:middle' alt='sad.gif' /> ....
  29. All in 1 server
    PHP4,PHP5,ASP.Net (13)
    Hello, I'm hosting my own site web on my computer. I'm using IIS6 with ASP.NET and PHP4
    running on it and I would like to install also PHP5 to try it. Do you think it's possible ?....

    1. Looking for saving, php, generated, image, server, needed






*SIMILAR VIDEOS*
Searching Video's for saving, php, generated, image, server, needed
advertisement




Saving A Php Generated Image To The Server - Help Needed Please