WXforum.net

Web Weather => Weather Website PHP/AJAX scripting => Topic started by: SoMDWx on February 05, 2020, 08:06:39 AM

Title: firedangerWD.php script
Post by: SoMDWx on February 05, 2020, 08:06:39 AM
Good morning all!

I was wondering if anyone knows how to crate a GIF image and store it to a file rather than having the script display the image when called...

I would like to have a physical file created from the image...

Thanks!

Jim
Title: Re: firedangerWD.php script
Post by: gwwilk on February 05, 2020, 08:53:30 AM
As I recall, you're fairly handy at scripting, so this 'heavens.php' (https://www.gwwilkins.org/heavens.php?sce=view) contains an example of just this sort of manipulation.

You can follow this variable to see what happens to it:
Code: [Select]
$pc_cacheFile = './cache/heavenpie.png'; // Relative path and name of cached image file

You can save the image in different formats, gif, png, or jpg by using the appropriate php function: imagegif(...), imagepng(...), or imagejpeg(...).

Hope this helps.

BTW, with 'firedangerWD.php (https://www.gwwilkins.org/firedangerWD.php?sce=view)' I've taken the opposite approach by using AJAX to update the image on my alternate dashboard in real time.