It is currently March 28th, 2024, 10:29 pm

Animated GIF issue

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote: June 21st, 2020, 7:10 am This morning it looks like this.

Yincognito's code is still running and displaying
The old code is also still running.

The Old code incorporated in the weather skin is showing some weird behavior.
The download and extraction have taken place, the animationloop is running and the skin is showing the fisrt frame of the animation. ( is the first time I notice this behavior. )
this moring.mp4

After the next update NO frames are shown
next update.mp4

Strange
Yeah, well, at least two versions are working properly. Why bother with the 3rd? You probably missed something in the details when integrating the old code into your skin, or it's somehow conflicting with the new skin's processes. But so that we're clear: how many of the "integrations" have succeeded? I understand than mine did (the pause/unpause one), any other besides that? Maybe the version you tweaked before I posted mine, right?
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Yincognito wrote: June 21st, 2020, 8:24 am Yeah, well, at least two versions are working properly. Why bother with the 3rd? You probably missed something in the details when integrating the old code into your skin, or it's somehow conflicting with the new skin's processes. But so that we're clear: how many of the "integrations" have succeeded? I understand than mine did (the pause/unpause one), any other besides that? Maybe the version you tweaked before I posted mine, right?
Yes , you are right.both of your 2 codes worked but i used the one with the pause/unpause coding

Thanks for all your effort on helpping me to resolve this issue which bothered me for a long time

This is the final code which works for me for whom is interested:
Also wich the integration this code workd :thumbup:

Code: Select all

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

---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
FinishAction=[!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtract "Run"]

---Measures RunCommand---

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!UnpauseMeasure MeasureAnimLoop]

---Measures Rainmeter---

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

---Meters---

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
ImageName=current[MeasureAnimLoop].png
PreserveAspectRatio=1
SolidColor=0,0,0,64
X=0
Y=0
W=232
H=232
DynamicVariables=1
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote: June 21st, 2020, 7:11 pm Yes , you are right.both of your 2 codes worked but i used the one with the pause/unpause coding

Thanks for all your effort on helpping me to resolve this issue which bothered me for a long time

This is the final code which works for me for whom is interested:
Also wich the integration this code workd :thumbup:

Code: Select all

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

---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
FinishAction=[!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtract "Run"]

---Measures RunCommand---

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!UnpauseMeasure MeasureAnimLoop]

---Measures Rainmeter---

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

---Meters---

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
ImageName=current[MeasureAnimLoop].png
PreserveAspectRatio=1
SolidColor=0,0,0,64
X=0
Y=0
W=232
H=232
DynamicVariables=1
Cool - glad it helped. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

I'm Back... :welcome:

I have some new findings, I think.

Today I had, again the issue that the animation was not running/working.
After a double refresh they pop up again but were also gone after a while.
The 'running time' seemed to shorten over time.
I have not checked after how long because I became a little bit frustrated, as you can imagine.

The only thing which helped was to restart the computer and after restart the animation kept running again for long time. My Laptop is ON for 24hr 7 days a week.

Could it be that there is in the background, some kind of, I don't know, overflow / caching / internet explorer problem and that this is causing this behavior?

Would this code [!CommandMeasure MeasureName "Reset"] help in that case, and if so where to put it inside the code?
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote: June 22nd, 2020, 9:33 pm I'm Back... :welcome:

I have some new findings, I think.

Today I had, again the issue that the animation was not running/working.
After a double refresh they pop up again but were also gone after a while.
The 'running time' seemed to shorten over time.
I have not checked after how long because I became a little bit frustrated, as you can imagine.

The only thing which helped was to restart the computer and after restart the animation kept running again for long time. My Laptop is ON for 24hr 7 days a week.

Could it be that there is in the background, some kind of, I don't know, overflow / caching / internet explorer problem and that this is causing this behavior?

Would this code [!CommandMeasure MeasureName "Reset"] help in that case, and if so where to put it inside the code?
First of all, I can understand frustration, as I've been there too, but you must remember that in order to identify and solve a problem, one must keep a clear head. Also, testing first the "log version" of the code I posted could have offered some additional info that maybe would have helped (i.e. on what part of the process the issue happened - if you were awake to see it, what error code RunCommand produced - if any, on which frame the animation stoppped, etc).

Secondly, I now noticed that the code you used didn't have my OnConnectErrorAction and OnDownloadErrorAction options included. That means the actions in the FinishAction will only be executed if everything (connection, download, etc.) is successful. If one of those operations fail, the bangs will not be executed, basically reducing your skin to the original state / code you posted in the first pages of this thread. Now I can't say that this will 100% solve the issue, as I've not written WebParser, Rainmeter and such, but I never ever do or write things without a reason, and the fact that I included those options or the logging was intentional, to help with either debugging or to cover (as I promised) all the angles / possibilities.

Regarding the WebParser reset, I have no idea if it would help, but you can of course try it. I only use WebParser reset in one of my skins (my feed aggregator skin) and that is only to clear a few MB of redundant data from the WebParser measure in the hope it will reduce the memory footprint of Rainmeter, as I pass that data to a String measure anyway - so I can't tell you if it helps with the cache and such, simply because the skin where I use it worked anyway even without the reset. Since we're at it, you might want to tackle a potential RunCommand issue as well, by investigating whether you could use the Timeout option in the corresponding measure (which you also removed from my posted code, LOL) or even the [!CommandMeasure MeasureName "Kill"] in order to be sure that the cmd.exe process (not sure if it'll have an effect on the gif2frame.exe process though) is closed after each run. Where to put them? That's easy: apart from the Timeout option whose place is obvious, you'd want to run the WebParser reset while RunCommand is running and the RunCommand kill while WebParser is running, since your workflow, besides the iteration through the PNGs, is basically an alternation between these two. In other words, you'd probably want to place them in the FinishAction of the opposite / other process (or even in the MeasureAnimLoop, although that could potentially be tricky due to the pause/unpause alternation). You could even use some of the new Flags option in WebParser, if you think it would help.

Other than that, the really undesirable culprits could be either a site block after a while, Rainmeter (not necessarily a WebParser) overflow or a conflict somewhere in the caching (not necessarily internet related) of the images themselves, i.e. the PNGs (although according to the manual, the use of DynamicVariables=1 on the meter to force the image to be reloaded from disk on every meter update - which is already done - should have taken out this possibility from the culprit list).

One other thing ... if you said that two refreshes always solve the issue, you could even run two [!Refresh] bangs one after the other once every couple of hours / updates or so. Take a look at the Counter function in the Calc measure, maybe it's suited as an alternative. Since that Counter function only resets to 0 on skin unload+reload, you'd want something like IfCondition=(MeasureCounter%3600=0) followed by IfTrueAction=[!Refresh][!Refresh] to do the operation once, say, every hour.

P.S. While I haven't kept my laptop running 24/7, I've kept it running for more than one full day (not sure if I reached 2 uninterrupted days), and although I didn't download and display images / extract GIFs from the internet, my internet related skins using the FinishAction / OnConnectErrorAction and in my case OnRegExpErrorAction trio only once stopped their normal process in like 4 years or so (and that was when I worked with other skins and did a lot of load refresh and such). Unfortunately, in your scenario, a long time is required to test if the skin works, and that makes the issue even more frustrating... :confused:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

I have made 2 skins with the original code besides deleting the frame counter in the log file.

Both I started with Refresh All command in rainmeter.exe
Resulting in:
Extraction Finished (Error Code: -1) (Weather_TWC\Weather_TWC.ini)
Extraction Finished (Error Code: -1) (Radar - Yincognito - Pause\Radar.ini)
Both skins show the animation!
Capture1.JPG
Now I let both skins update themselves.
1st update
Extraction Finished (Error Code: 0) (Weather_TWC\Weather_TWC.ini)
Extraction Finished (Error Code: 1) (Radar - Yincognito - Pause\Radar.ini)
Weather skin NO animation
Radar skin is showing animation.
Capture2.JPG
What does the error code tell me???
It can be -1, 0, 1
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

I have speeded up the dowload interval by setting UpdateWebParser=100
original it was UpdateWebParser=600

Now I see this:
Capture3.JPG
even with error code: 0 for weather_TWC the animation is displayed

The next update looks like this
Capture4.JPG
The next like this:
Capture5.JPG
It seems that the number of this error code is not responsible for displaying or not displaying the animation in the weather_twc skin.

These are the times the update takes place and if the animation is displayed or not
at first you would think there is a pattern every 10 minutes 11:26:13 / 11:36:13 / 11:46:13 where the animation is not displayed
But after 11:46:13 it took 3 updates do display the animation again and from that time it became more eradicate.

Why, I don't know.

11:17:52 refresh skin; yes
11:19:32 yes
11:21:12 yes
11:22:52 yes
11:24:33 yes
11:26:13 no
11:27:52 yes
11:29:36 yes
11:31:12 yes
11:32:52 yes
11:34:34 yes
11:36:13 no
11:37:52 yes
11:39:32 yes
11:41:12 yes
11:42:52 yes
11:44:33 yes
11:46:13 no
11:47:53 no
11:49:33 no
11:51:14 yes
11:52:53 yes
11:54:33 yes
11:56:13 yes
11:57:53 yes
11:59:32 no
12:01:13 yes
12:02:55 yes
12:04:33 no
12:06:12 yes
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Rainmeter Sage
Posts: 7029
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote: June 23rd, 2020, 9:32 am I have speeded up the dowload interval by setting UpdateWebParser=100
original it was UpdateWebParser=600

Now I see this:Capture3.JPG
even with error code: 0 for weather_TWC the animation is displayed

The next update looks like this
Capture4.JPG

The next like this:
Capture5.JPG

It seems that the number of this error code is not responsible for displaying or not displaying the animation in the weather_twc skin.

These are the times the update takes place and if the animation is displayed or not
at first you would think there is a pattern every 10 minutes 11:26:13 / 11:36:13 / 11:46:13 where the animation is not displayed
But after 11:46:13 it took 3 updates do display the animation again and from that time it became more eradicate.

Why, I don't know.

11:17:52 refresh skin; yes
11:19:32 yes
11:21:12 yes
11:22:52 yes
11:24:33 yes
11:26:13 no
11:27:52 yes
11:29:36 yes
11:31:12 yes
11:32:52 yes
11:34:34 yes
11:36:13 no
11:37:52 yes
11:39:32 yes
11:41:12 yes
11:42:52 yes
11:44:33 yes
11:46:13 no
11:47:53 no
11:49:33 no
11:51:14 yes
11:52:53 yes
11:54:33 yes
11:56:13 yes
11:57:53 yes
11:59:32 no
12:01:13 yes
12:02:55 yes
12:04:33 no
12:06:12 yes
Yeah, in general, the error code shouldn't be from 3 digits (which would mean it's not good) - as long as it's one digit (0,-1,1) it should be ok, meaning there wasn't any apparent connection or download error in the process. Ideally, however, you'd want the error code to always be 1, which means the operation was successful, according to The number value of the measure paragraph of RunCommand in the manual (this is where you can read what those error codes mean, besides the 3 digits error codes - that appear to never happened, which are further down the page). In theory, this error code should have been 1 all the time, since the log happens in the FinishAction of the RunCommand measure, but apparently things happen fast and sometimes, although the resource appears to be extracted and working fine, the error code shows that at the time of logging the command has either not being run yet or didn't yet finish.

I'll try to make the code always show 1 later on today. As I said, for me the code worked fine and most of the error codes were 1 the last time I ran it, but obviously I didn't kept it running for hours, days or weeks like you.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

The error code number is always 1 digit. -1, 0 or 1

The yes / no I only used to indicate when the animation was shown and not.

Even with error code '0' the animation was OK.

Also with error code '1' the animation was sometimes NOT showing.
Capture4.JPG
That is why I think it has nothing to do with the state of the error.
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 207
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

But as you also can see in the pictures is that the stand alone radar skin (NOT incorporated / right radar image) is always running.

So I modified the code in the weather_twc skin with:

MouseOverAction=[!ShowFade "Radar" "Radar.ini"]
MouseLeaveAction=[!HideFade "Radar" "Radar.ini"]

So the radar stand alone skin if faded IN or OUT depending on the hover action of the mouse in the weather_twc skin.

Till now it's running OK.