PHP animated gifs for GR3 radar & other uses?

Fishdude,

We’re running a program called GR Level 3 available at http://www.grlevelx.com/. They have a trial version available, but I don’t remember if that one will publish to the web or not. I’ve really enjoyed the program. - Jim

When I logged on to the forum this morning I noticed that the “radar out” symbol was showing, which was good because it really was intermittant. The problem is that most of the frames in the animation had the symbol in a maroon color, but a couple came up bright red just like in the overlay.

I seem to remember that there can be pallette problems when resizing, so that’s probably where the issue is. I’ll have to do a little research today, but if anyone has experience with that, please let me know. - Jim

Can someone offer a suggestion on GR3 web publishing? I run GR3 on the same PC as my web server, and would like to publish the files without having to set up an ftp server :(. Anyone found a way to have it just drop the files in a folder?

I’m running GRLevel3 1.12, and there’s no options to drop the file in a folder… wish there was :wink:

You could set up a local FTP server on your webserver and ftp to 127.0.0.1 to put them into the folder you want. BTW… only the purchased version will do uploads… the trial version won’t publish.

Another small foible to keep in mind is publishing with the purchased version doesn’t start when the program starts up – it has to be started via the menu. I suppose it’s that way so you can run multiple copies with one publishing and another allowing you to explore other radar sites without disturbing the publishing.

Ken

Back when carterlake started with this I wrote an autostarter for GR3 that also starts FTP. PM me if you would like to try it. On second thoughts it’s probably better to just post the code for you AutoIt fans to convert.

I’ve been meaning to ask… can that be publicly (legally?) posted for others to use? I always like to share. :wink:

You can share it with anyone :slight_smile: but I probably wouldn’t post the version you have because it hard codes the startup directory of GR3 and the speed of sending keystrokes, both of which I had to customize for other users. I could make a new version with that info in an .ini file, but it might be better for someone who has GR3 to write an AutoIt script which could automate the GR3 window more directly. I didn’t have access to GR3 so mine is a very unsophisticated button pusher.

Let>APP_TITLE=GRlevel3 Starter
RunProgram>C:\Program Files\GRLevelX\GRLevel3\grlevel3.exe
WaitWindowOpen>GRLevel3*
Wait>1
Press>ALT
Sen>F
Release>ALT
Press>Down
Wait>2
Press>Down
Wait>2
Press>Down
Wait>2
Press>Down
Wait>2
Press>Down
Wait>2
Press>Enter
Wait>2
Press>Enter
Wait>2
Press>Enter
Label>theend

http://members.cox.net/carterlakeweather/grstart.zip

but I probably wouldn't post the version you have

What are they going to do? Yell at me? :wink:

(Hey, if this doesn’t work for you, Niko takes requests. :smiley: )

Thanks for the tips. I’ve had a registered copy of GR3 for a while, but never integrated it with my site. I wish they would add save to file. I put up a copy of BP-FTP Server that I have and I’m sending images to it via 127.0.0.1. I’m working on a good background that is appealing but doesn’t have too much detail to interfere with the radar data. I hadn’t used AutoIt, but now that I’ve played with it a bit I don’t know what I did without it! I was able to create an executable start file for GR3 in no time. Very cool program. 8) Time and testing will tell if GR3 makes it into my radar pages and replaces some of the other feeds. :signthanks: for the pointers!

I’ve updated the zip file to take care of a couple bugs. Bill from the Gibson Ridge forum found that I’d messed up a variable that would affect anyone who was uploading GR3 .png files. I also had some palette issues when the “radar out” overlay came into play. That was a rough one for me, but I believe I have it cured. Those who have the script already in use need only swap out the attached changefile.php and that will take care of everything.

Download at jcweather.us/animategr3.zip


changegfile.php.txt (6.58 KB)

Okay another stupid question. When jmcmurry means put in the directory does he mean on your computer or on the web server.

Chuck

Chuck,

The way I’m using it is with the PHP files in the same directory where I have the GR3 files uploading on the web server. You can change that in the code though if you wish. - Jim

Do you put all files in the directory including all the gifs, jpegs, pngs. Thats what I have right now and nothing is happening. Plus I have an issue right now my GR3 is not uploading to the site. It has not uploaded in two days now.

Chuck

Chuck,

Yes, all those files go there unless you change their location in the code. Some of the graphics are duplicates in different file formats and are just there in case folks want to try them that way. Remnants of my testing otherwise and can be deleted. - Jim

I deleted them out of the file. I did not change the location in the code. My radar is down right now and plus my GR3 is not uploading to my web server. I don’t if because the radar is not be updated is the reason my GR3 is not uploading. But it was up yesterday but my files show the 7th of December. I have tried and looked at everything I can think of. I will just wait and see when the radar comes back up to see if that changes things.

Chuck

This is my animategr3.php. My files are in the subdirectory radar. Is this right way or do I need to change something else.

<?php
...
require('changegfile.php');
require('GifMerge.class.php'); //Expects files relative to where this file is located vs $_SERVER['DOCUMENT_ROOT'].  Hence all the work with paths below.
$iarray = array("br1_9.jpg","br1_8.jpg","br1_7.jpg","br1_6.jpg","br1_5.jpg",  //Files to be processed.
			    "br1_4.jpg","br1_3.jpg","br1_2.jpg","br1_1.jpg","br1_0.jpg");
$oarray = array("br1_9.gif","br1_8.gif","br1_7.gif","br1_6.gif","br1_5.gif",  //Interim gif files.
			    "br1_4.gif","br1_3.gif","br1_2.gif","br1_1.gif","br1_0.gif"); //Anything you want them to be.			    
$d = array(100, 100, 100, 100, 100, 100, 100, 100, 100, 200); //Delays between frames.
$x = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //Origin of x for each frame.
$y = array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0); //Origin of y.
$filedir = $_SERVER['DOCUMENT_ROOT'] . "/radar/"; //Subdirectory below your web "root" where files are located.
$afile = "animatedgr3.gif"; //The file to be produced.
$radaroutfile = $filedir . "radarout.gif"; //The radar out overlay provided.  Make it "" if not using.
?>

Chuck,

I just looked on Wunderground and yes, the Minot radar is down for maintenance. When that happens, GR3 won’t upload anything and the PHP script will notice that and place the “radar down” symbol over the animation. If you want, you could change to another radar … or you can wait.

  • Jim

Let me upload all the files again. I was not showing radar down at all. I will let you know when I have all the files uploaded.

Chuck

I reuploaded the files to the radar subdirectory.

Chuck

Jim,

My radar is back up and running. Did you take a look at my animategr3.php file and see if I have it configured correctly. As of right now nothing is being produced.

Chuck

Chuck,

When I run it I get a ton of errors and it seems as though it’s not finding your radar files correctly. Did you modify your script to accomodate your \radar\ directory. Another thought is that if you have GR3 appending the radar name to the files, you’ll have to add that too. - Jim