It is currently April 19th, 2024, 2:24 am

Weather Radar skin help

Get help with creating, editing & fixing problems with skins
scub
Posts: 30
Joined: May 16th, 2015, 10:37 pm

Weather Radar skin help

Post by scub »

Hi,
im making (or trying to) create a skin that displays a weather image radar on desktop. basically make a plugin that downloads this image: http://sirocco.accuweather.com/nx_mosaic_400x300_public/sir/inmasirCT_.gif


everything works, and simple, but there is one problem.. it's animated gif (radar loop) and only displays the first frame. after some research, i discovered rainmeter doesn't really support animated gifs :(

i found some tips from other threads about making rainmeter work with animated gif by chopping up the gif into frames, but that's for a static animated gif.. how would i go abouts doing it from a dynamic gif using the RSS/Webparser? ideally i would love if i could keep the animation/loop, but if it too much work to write a plugin, how about getting the last frame? otherwise getting the first frame as it currently is means it's pretty old radar frame.

this is what i came up with this code below (keep in mind i am very new with rainmeter).
maybe someone can help me? they also get a nice radar loop image that i have found from Accuweather ;) if i recall, the radar gif from accuweather gets updated every 15 minutes.

i check and appears the "inmasirCT_.gif" file is downloading is animated, but obviously in the skin rainmeter only showing the first frame..

i want to keep it as simple as possible because im still learning with rainmeter. any tips for keeping animation or at least the last frame of the gif?

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureWebParser]
UpdateRate=1800
Measure=Plugin
Plugin=Webparser
Url=http://sirocco.accuweather.com/nx_mosaic_400x300_public/sir/inmasirCT_.gif
Download=1
DownloadFile=inmasirCT_.gif

[MeterWebParser]
Meter=IMAGE
MeasureName=MeasureWebParser
;ImageCrop=-200,-151,400,300,5
;W=300
PreserveAspectRatio=1
Antialias=1
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Radar skin help

Post by jsmorley »

Gif2Frames_1.0.rmskin

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1

[MeasureAnimLoop]
Measure=Calc
Formula=(MeasureAnimLoop % 9) + 1
Disabled=1

[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=http://sirocco.accuweather.com/nx_mosaic_400x300_public/sir/inmasirCT_.gif
Download=1
DownloadFile=current.gif
ForceReload=1
FinishAction=[!CommandMeasure MeasureExtract "Run"]

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!SetOption MeterAnimLoop ImageName current0000[*MeasureAnimLoop*].png][!EnableMeasure MeasureAnimLoop]

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
DynamicVariables=1
Click to animate:
test.gif
This uses a little command line utility from http://www.umbrellastudio.com/tools/extract-frames-from-an-animated-gif/, which is included with the .rmskin. It also uses the RunCommand pluing from brian, http://rainmeter.net/forum/viewtopic.php?p=92974#p92974, also included with the .rmskin.
You do not have the required permissions to view the files attached to this post.
scub
Posts: 30
Joined: May 16th, 2015, 10:37 pm

Re: Weather Radar skin help

Post by scub »

i was searching for more radar images, and found a static one that shows the last frame
(just in case anyone wants to use them just change the "CT" abbv. to your state in most cases).
http://sirocco.accuweather.com/nx_mosaic_400x300_public/sir/inmsirct_.gif
and a bigger animated one without the white top and bottom bars: http://sirocco.accuweather.com/nx_mosaic_640x480_public/sir/inmasirCT_.gif
and a slightly smaller animated one with date: http://sirocco.accuweather.com/nx_mosaic_234x175_public/sir/inmasirCT_.gif
(beats resizing them which distorts the timestamp/text)

before you came to the rescue, i was looking through the accuweather source to see if they already had individual split frame images, but came up empty so i could download them and loop them. there are other weather sites that save individual frames, but don't really like those low-resolution radar they have. the accuweather by far looks much better.

just notice a little quirk, it downloads the last frame 3 extra times? tried changing the "9" (it's making 9 frames instead of 6) but that had no effect?

thanks a lot!
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Radar skin help

Post by jsmorley »

scub wrote:i was searching for more radar images, and found a static one that shows the last frame
(just in case anyone wants to use them just change the "CT" abbv. to your state in most cases).
http://sirocco.accuweather.com/nx_mosaic_400x300_public/sir/inmsirct_.gif
and a bigger animated one without the white top and bottom bars: http://sirocco.accuweather.com/nx_mosaic_640x480_public/sir/inmasirCT_.gif
and a slightly smaller animated one with date: http://sirocco.accuweather.com/nx_mosaic_234x175_public/sir/inmasirCT_.gif
(beats resizing them which distorts the timestamp/text)

before you came to the rescue, i was looking through the accuweather source to see if they already had individual split frame images, but came up empty so i could download them and loop them. there are other weather sites that save individual frames, but don't really like those low-resolution radar they have. the accuweather by far looks much better.

just notice a little quirk, it downloads the last frame 3 extra times? tried changing the "9" (it's making 9 frames instead of 6) but that had no effect?

thanks a lot!
It doesn't download any "frames", just downloads the .gif file. That Gif2Frames utility then just extracts whatever is in the .gif. No doubt those 3 extra frames are in the gif to create a "pause" at the end when it is viewed as an animated gif. You can eliminate them by changing:

Formula=(MeasureAnimLoop % 9) + 1

to:

Formula=(MeasureAnimLoop % 6) + 1
scub
Posts: 30
Joined: May 16th, 2015, 10:37 pm

Re: Weather Radar skin help

Post by scub »

ah, i had noticed the pause at the end is where the extra gifs were coming from.
i made some more changes to the plugin in case anyone wants to use it.

made it loop faster by changing update to 500 and made the final frame pause even longer, as the final frame is the most important.
middle mouse button refreshes the radar and clicking the radar opens up a html file with larger version, plus some other maps i have..

thanks again.

Code: Select all

[Rainmeter]
Update=500
DynamicWindowSize=1
MiddleMouseUpAction=!Refresh

[MeasureAnimLoop]
Measure=Calc
Formula=(MeasureAnimLoop % 9) + 1
IfEqualValue=5
IfEqualAction=[!SetOption MeasureAnimLoop UpdateDivider 2]
IfAboveValue=5
IfAboveAction=[!SetOption MeasureAnimLoop UpdateDivider 1]
Disabled=1

[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=http://sirocco.accuweather.com/nx_mosaic_234x175_public/sir/inmasirCT_.gif
Download=1
DownloadFile=current.gif
ForceReload=1
FinishAction=[!CommandMeasure MeasureExtract "Run"]

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!SetOption MeterAnimLoop ImageName current0000[*MeasureAnimLoop*].png][!EnableMeasure MeasureAnimLoop]

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
DynamicVariables=1
W=234
PreserveAspectRatio=1
Antialias=1
LeftMouseDownAction=!execute ["file:///D:/Program%20Files/Rainmeter/Skins/Gif2Frames/radar.html"]
Laaglander
Posts: 15
Joined: April 25th, 2015, 9:45 pm

Re: Weather Radar skin help

Post by Laaglander »

Hello,

I downloaded your file and updated it with your lost post. But now i cannot get it moved to another location on my desktop. And yes i have the option movable checked.

can you help me please?
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Weather Radar skin help

Post by jsmorley »

Laaglander wrote:Hello,

I downloaded your file and updated it with your lost post. But now i cannot get it moved to another location on my desktop. And yes i have the option movable checked.

can you help me please?
Change his LeftMouseDownAction to LeftMouseUpAction.

Sent from my Kindle Fire HDX
Laaglander
Posts: 15
Joined: April 25th, 2015, 9:45 pm

Re: Weather Radar skin help

Post by Laaglander »

thanks for the quick responce, and it is working!

thanks again
scub
Posts: 30
Joined: May 16th, 2015, 10:37 pm

Re: Weather Radar skin help

Post by scub »

Lol so i figured what else i can improve, this is kind of addicting. ;)
decided to make it clickable to show enlarged popup of the larger radar image loop, clicking will close it, middle mouse refresh

i tried to simplify the code as much as possible, tried passing two images to gif2frames.exe
(the small thumb and larger radar) using gif2frames.exe <name>.gif <name>.gif

even though this looks to be possible with the gif2frames i had some problems so i just ended up running it twice, once for the thumb and one for the larger image.

one problem i do have is when i put the radar to the right side of my desktop the popup is half hidden, how can i position the popup perhaps to open at the center of the screen despite where the skin is located?

lastly, the popup tends to be under other skins when it opens, i tried using AlwaysOnTop=1
or am i using this wrong?

thanks

Code: Select all

[Rainmeter]
Update=500
DynamicWindowSize=1
MiddleMouseUpAction=!Refresh

[MeasureAnimLoop]
Measure=Calc
Formula=(MeasureAnimLoop % 9) + 1
IfEqualValue=5
IfEqualAction=[!SetOption MeasureAnimLoop UpdateDivider 2]
IfAboveValue=5
IfAboveAction=[!SetOption MeasureAnimLoop UpdateDivider 1]
Disabled=1

[MeasureImage_tn]
Measure=Plugin
Plugin=WebParser
URL=http://sirocco.accuweather.com/nx_mosaic_234x175_public/sir/inmasirCT_.gif
Download=1
DownloadFile=current_tn.gif
ForceReload=1
UpdateDivider=1920
FinishAction=[!CommandMeasure MeasureExtract "Run"]

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current_tn.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!SetOption MeterAnimLoop ImageName current_tn0000[*MeasureAnimLoop*].png][!EnableMeasure MeasureAnimLoop]

[MeasureAnimLoop2]
Measure=Calc
Formula=(MeasureAnimLoop2 % 9) + 1
IfEqualValue=5
IfEqualAction=[!SetOption MeasureAnimLoop2 UpdateDivider 2]
IfAboveValue=5
IfAboveAction=[!SetOption MeasureAnimLoop2 UpdateDivider 1]
Disabled=1

[MeasureImage]
Measure=Plugin
Plugin=WebParser
URL=http://sirocco.accuweather.com/nx_mosaic_640x480_public/sir/inmasirCT_.gif
Download=1
DownloadFile=current.gif
ForceReload=1
UpdateDivider=1920
FinishAction=[!CommandMeasure MeasureExtract2 "Run"]

[MeasureExtract2]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!SetOption MeterAnimLoop2 ImageName current0000[*MeasureAnimLoop2*].png][!EnableMeasure MeasureAnimLoop2]

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
DynamicVariables=1
Antialias=1
LeftMouseUpAction=!ToggleMeterGroup LargeView

[MeterAnimLoop2]
Hidden=1
Group=LargeView
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
DynamicVariables=1
PreserveAspectRatio=1
AlwaysOnTop=1
LeftMouseUpAction=!ToggleMeterGroup LargeView
scub
Posts: 30
Joined: May 16th, 2015, 10:37 pm

Re: Weather Radar skin help

Post by scub »

ok i figured it out.. i ended up making two skins, one for the small thumb radar loop and another for the larger loop. i then used !Move using #SCREENAREAWIDTH# and #SCREENAREAHEIGHT# to center the larger popup on the display, and used !ToggleConfig on the small radar to open and close popup enlarged radar.

i had some trouble as it appears rainmeter doesn't allow two skins to be loaded at the same time if they are in the same folder (not even creating a subfolder inside the skin) worked.. what happened was every time i tried to close the skin it would deactivate itself.. maybe i was just doing something wrong.

since i also wanted the small radar to remain open (e.g: clicking the small radar opens AND closes the larger one) the only solution was to have two separate skins.. otherwise every type of method i tried cause the small skin to close right after the larger radar opened. i made it so mousing over the large radar closes it, or by clicking the small radar.

guess there is also a bonus using two skins as only one needs to be loaded and the other is off until toggled/untoggled using less resources.

working great..