It is currently March 28th, 2024, 9:58 am

Animated GIF issue

Get help with creating, editing & fixing problems with skins
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Thanks to all of you for making it work stable... :thumbup:
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

jsmorley wrote: June 24th, 2020, 6:18 pm Yeah, I'm that guy that sticks his nose in a thread to pick off some low hanging fruit, then disappears again when it's a tough question... ;-)

Then you're lucky because all issues have been resolved. :rolmfao:

But hey, all input is welcome.
Keep up the good work.
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

jsmorley wrote: June 24th, 2020, 6:18 pm Yeah, I'm that guy that sticks his nose in a thread to pick off some low hanging fruit, then disappears again when it's a tough question... ;-)
I kind of realized that some time ago, haha! :D
Not to worry, it's better this way, you have other tough things to do anyway ... like setting a bunch of .inc files for all of us lazy folks to use in our weather skins. ;-)

Joking aside, this doesn't happen all the times. Let's say that "you have your moments" (which is perfecly understandable)... 8-)
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote: June 24th, 2020, 6:18 pm Thanks to all of you for making it work stable... :thumbup:
So this is the final verdict? Is it finally stable? Using the fade effect, I suppose, right?
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Yes, with the fade effect or balala must come with a stable sliding window version :lol:
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote: June 24th, 2020, 6:29 pm Yes, with the fade effect or balala must come with a stable sliding window version :lol:
Ouch! :rofl: Then I guess balala is lucky for the moment, or the issue got scared of his Rainmeter skills and gave up causing trouble... :D
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Hello Guy's

I've seen in the coding of buienradar that there is also a animated gif with lightning history which you can use.
In Stead of the original Rain forecast URL
https://image.buienradar.nl/2.0/image/animation/RadarMapRainNL?height=500&width=500&extension=gif&renderBackground=True&renderBranding=False&renderText=True&history=3&forecast=6&skip=1

You can use the Lightning URL:
https://image.buienradar.nl/2.0/image/animation/RadarMapLightningNL?height=500&width=500&extension=gif&renderBackground=True&renderBranding=False&renderText=True&history=3&forecast=0&skip=1


The intension is to make a code that ;
1] downloads the GIF with 9 frames (3 history and 6 forecast) of the Rain animation
2] extracts the 9 frames with gif2frames
3] downloads the GIF with 3 frames (3 history and 0 forecast) of the Lightning animation (there is no forecast for lightning) in the same folder as the Rain download
4] extracts the 3 frames with gif2frames (first 3 frames (from point 2 ) of the rain animation will be overwritten by the Lightning frames and files.
5] Display the animation with the 9 frames (3 history with Lightning and 6 with Rain forecasting)

This is the skin I have made:
Radar_plus_.rmskin
(595.63 KiB) Downloaded 10 times
This is the code:

Code: Select all

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

[Variables]
BackgroundColor=0,0,0,50
BackgroundColor2=0,0,0,160

UpdateInterval=1000
UpdateWebParser=600
Delay=0

---Measures WebParser---

[MeasureImage]
Measure=WebParser
URL=https://image.buienradar.nl/2.0/image/animation/RadarMapRainNL?height=500&width=500&extension=gif&renderBackground=True&renderBranding=False&renderText=True&history=3&forecast=6&skip=1
Download=1
DownloadFile=current.gif
ForceReload=1
UpdateRate=1
UpdateDivider=(#UpdateWebParser#*1000/#UpdateInterval#)
FinishAction=[!Log "DL Rain"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtract "Run"]
OnConnectErrorAction=[!Log "Connection Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtract "Run"]
OnDownloadErrorAction=[!Log "Download Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtract "Run"]
DynamicVariables=1

---Measures RunCommand---

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
State=Hide
OutputType=ANSI
Timeout=5000
FinishAction=[!Log "Ext Rain"][!EnableMeasure MeasureImageLight][!CommandMeasure  MeasureImageLight "Run"]
DynamicVariables=1

[MeasureImageLight]
Measure=WebParser
URL=https://image.buienradar.nl/2.0/image/animation/RadarMapLightningNL?height=500&width=500&extension=gif&renderBackground=True&renderBranding=False&renderText=True&history=3&forecast=6&skip=1
Download=1
DownloadFile=current.gif
ForceReload=1
UpdateRate=1
UpdateDivider=(#UpdateWebParser#*1000/#UpdateInterval#)
FinishAction=[!Log "DL Light"][!Delay #Delay#][!EnableMeasure MeasureExtractLight][!CommandMeasure MeasureExtractLight "Run"]
OnConnectErrorAction=[!Log "Connection Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtractLight "Run"]
OnDownloadErrorAction=[!Log "Download Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtractLight "Run"]
DynamicVariables=1
Disabled=1

---Measures RunCommand---

[MeasureExtractLight]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
State=Hide
OutputType=ANSI
Timeout=5000
FinishAction=[!Log "Ext Light"][!Delay 1000][!DisableMeasure MeasureImageLight][!DisableMeasure MeasureExtractLight][!UnpauseMeasure MeasureAnimLoop]
DynamicVariables=1
Disabled=1

---Measures Rainmeter---

[MeasureAnimLoop]
Paused=1
Measure=Calc
Formula=((MeasureAnimLoop%9)+1)
RegExpSubstitute=1
Substitute="^(.*)$":"0000\1","^.*(.{5})$":"\1"
DynamicVariables=1

---Meters---

[MeterBackground]
Meter=Shape
Shape=Rectangle 0,0,236,236,5 | Fill Color #Backgroundcolor2# | StrokeWidth 1.5 | Stroke Color #Backgroundcolor#
X=315
Y=596

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
ImageName=current[MeasureAnimLoop].png
PreserveAspectRatio=1
;SolidColor=0,0,0,160
Imagetint=255,255,255,155
X=2r
Y=2r
W=232
H=232
DynamicVariables=1
When I load the skin All seems to be OK and functional but at the first update the code gets stuck!
Example of running code after loading skin:
Running.mp4
(582.48 KiB) Downloaded 10 times
Example of stuck code during 1st update skin:
Pause.mp4
(1 MiB) Downloaded 8 times
Resulting in sometimes an error but also the sequence at the update time is NOK:
Capture.JPG
Could you have a look what I did wrong?
User avatar
Yincognito
Rainmeter Sage
Posts: 7017
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote: June 28th, 2020, 5:53 pm Hello Guy's

I've seen in the coding of buienradar that there is also a animated gif with lightning history which you can use.
In Stead of the original Rain forecast URL
https://image.buienradar.nl/2.0/image/animation/RadarMapRainNL?height=500&width=500&extension=gif&renderBackground=True&renderBranding=False&renderText=True&history=3&forecast=6&skip=1

You can use the Lightning URL:
https://image.buienradar.nl/2.0/image/animation/RadarMapLightningNL?height=500&width=500&extension=gif&renderBackground=True&renderBranding=False&renderText=True&history=3&forecast=0&skip=1


The intension is to make a code that ;
1] downloads the GIF with 9 frames (3 history and 6 forecast) of the Rain animation
2] extracts the 9 frames with gif2frames
3] downloads the GIF with 3 frames (3 history and 0 forecast) of the Lightning animation (there is no forecast for lightning) in the same folder as the Rain download
4] extracts the 3 frames with gif2frames (first 3 frames (from point 2 ) of the rain animation will be overwritten by the Lightning frames and files.
5] Display the animation with the 9 frames (3 history with Lightning and 6 with Rain forecasting)

This is the skin I have made:
Radar_plus_.rmskin

When I load the skin All seems to be OK and functional but at the first update the code gets stuck!
Example of running code after loading skin:
Running.mp4

Example of stuck code during 1st update skin:
Pause.mp4
Resulting in sometimes an error but also the sequence at the update time is NOK:
Capture.JPG

Could you have a look what I did wrong?
Just tested your skin and while I did experience a "stuck moment" at the 4th frame on the first update (where the last 2 operations didn't complete, probably due to some of the measure disable operations interfering), I got no errors and everything worked fine afterwards. As usual when testing / debugging your skin, I set up the UpdateWebParser to 60 (i.e. 1 minute) to speed up the process and not stay for hours staring at the display waiting for some visual indicatiion of what's happening - I just say that so you can read the screenshot below and the timings properly, I'm not implying that you should do the same:
RadarPlus.jpg
I'll take a look at the code tomorrow, but in the meantime I have some things that don't seem that clear to me:
- you said you wanted to download only the 3 history frames for lightning, as per the link you posted, but in the code the 2nd URL also attempts to download the 6 forecast frames for lightning; is this a typo / mistake or something intentional, and if the latter, why?
- I'm thinking, is this the only way of getting these kind of frames, or there is a possibility of "building" and "downloading" the GIF with 3 historical lightning and 6 forecast rain right from the start, through some sort of alternate / tweaked URL syntax? Maybe you could check it out, as I don't know Dutch so I can't use my intuition properly when examining the page source...

Other than that, I might be wrong with this (will have a clearer idea about it tomorrow when working with the code), but from the top of my head, apart from starting [MeasureImageLight] disabled to prevent its first run after refreshing the skin, I believe setting either its UpdateDivider or its UpdateRate to -1 will suffice, as the measure will only be executed with [!CommandMeasure MeasureImageLight "Update"] (and not with [!CommandMeasure MeasureImageLight "Run"] as the "Run" command is only suited for RunCommand plugin measures, not WebParser ones) from the preceding measure anyway, meaning it won't have anything to do with its own regular update cycle, but rather the update cycle (and the finish/etc. actions) of the "rain" measures. Also, the RunCommand measures don't necessarily need to be disabled as they are only triggered by commanding the measure to "Run".
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Hello yincognito,

The 2nd url with 6 forecasting is a type, should be 0.
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

I have adjusted the code with your comments UpdateRate=-1 and calling the webparser with the [!CommandMeasure MeasureImageLight "Update"] and it works, code does not get stuck, ...BUT now I see this happening:
extract error.mp4
(815.09 KiB) Downloaded 9 times
Somehow during the extraction of the Lightning GIF the produced PNG's are not usable???

The next update is the opposite, the rain png are not correct

The next update(s) all is working perfectly.

This is the skin:
Radar_plus_.rmskin
(589.44 KiB) Downloaded 13 times
Post Reply