It is currently August 5th, 2020, 1:30 pm

Animated GIF issue

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 11156
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Animated GIF issue

Post by balala »

Yincognito wrote:
June 20th, 2020, 7:03 pm
I'm thinking that extracting those individual images with WebParser and showing them one by one could also be a solution to this.
Right, especially that such a step should avoid using the gif2frames.exe app and this could probably eliminate the hiding of the animation. I suppose...
User avatar
Yincognito
Posts: 2143
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

balala wrote:
June 20th, 2020, 7:19 pm
Right, especially that such a step should avoid using the gif2frames.exe app and this could probably eliminate the hiding of the animation. I suppose...
Yeah, that was my reasoning as well. Not sure if it will be faster or slower though... :???:

Anyway, I think the pause/unpause version below, if it doesn't produce negative effects for JamX, is probably the best one can do in this GIF scenario. It doesn't disable anything, and, aside from the normal "blank period" on refresh (i.e. until the GIF is first downloaded and its frames extracted), it works smoothly. Naturally, between the current PNG file on display and the newly downloaded / extracted one following it there will be differences and some very short period of animation "freeze" / "pause", but that's normal and as long as the image doesn't dissapear from the screen I think it's a reasonable compromise, given the fact that the animation freeze / pause is basically impossible to notice anyway, not to mention it lasts only around half a second on my system.

Here it is:

Code: Select all

[Variables]
UpdateInterval=1000
UpdateWebParser=600
Delay=0

[Rainmeter]
Update=#UpdateInterval#
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
UpdateRate=1
UpdateDivider=(#UpdateWebParser#*1000/#UpdateInterval#)
OnUpdateAction=[!Log "Download Started"]
FinishAction=[!Log "Download Finished"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!Log "Extraction Started"][!CommandMeasure MeasureExtract "Run"]
OnConnectErrorAction=[!Log "Connection Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!Log "Extraction Started"][!CommandMeasure MeasureExtract "Run"]
OnDownloadErrorAction=[!Log "Download Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!Log "Extraction Started"][!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 "Extraction Finished (Error Code: [MeasureExtract:])"][!Delay #Delay#][!UnpauseMeasure MeasureAnimLoop]
DynamicVariables=1

---Measures Rainmeter---

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

---Meters---

[MeterAnimLoop]
Meter=Image
ImagePath="#CURRENTPATH#DownloadFile"
ImageName="current[MeasureAnimLoop].png"
PreserveAspectRatio=1
SolidColor=0,0,0,64
X=0
Y=0
W=534
H=534
DynamicVariables=1
Everything is configurable:
- the general update interval (i.e. the UpdateInterval variable, in milliseconds)
- the WebParser measure update interval (i.e. the UpdateWebParser variable, in seconds - this stays at the set value, due to the WebParser's UpdateDivider formula)
- the delay period (i.e. the Delay variable, in milliseconds)
I tested this by setting UpdateWebParser=60 (i.e. once a minute) in order to speed up the result analysis, and it worked fine for more than 10 download & extract "sessions". Hopefully it'll be the same for JamX.

P.S. As previously mentioned, the logging and the delays could be removed eventually and if stuff works without them, then all good. My impression is that the delays don't serve that much of a purpose in this case, but hey, I could be wrong. :confused:
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

3 skins are running.
The original one I adjusted yesterday (which is still running. (Middel animation)
The skin where I have tried to incorporate the original code into (Left animation)
The code from Yincognito (Right side)
3 skins running.mp4
Here is the update of the 3 skins
Update 3 skins.mp4
As can be seen the middel and right one are displayed after the update but the left one fails.
You do not have the required permissions to view the files attached to this post.
Last edited by JamX on June 20th, 2020, 8:23 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 11156
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Animated GIF issue

Post by balala »

JamX wrote:
June 20th, 2020, 8:03 pm
3 skins are running.
So, are they ok now? Is there anything else to help you with?
User avatar
Yincognito
Posts: 2143
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote:
June 20th, 2020, 8:03 pm
3 skins are running.
The original one I adjusted yesterday (which is still running. (Middel animation)
The skin where I have tried to incorporate the original code into (Left animation)
The code from Yincognito (Right side)

3 skins running.mp4
Nice! I assume you used my last posted code (the one using pause/unpause), right?
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Here is the update of the 3 skins
Update 3 skins.mp4
As can be seen the middel and right one are displayed after the update but the left one fails.
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Yincognito wrote:
June 20th, 2020, 8:14 pm
Nice! I assume you used my last posted code (the one using pause/unpause), right?
Yes, but not in the left skin.

I'll incorporate it into the left skin and see what happens
User avatar
Yincognito
Posts: 2143
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote:
June 20th, 2020, 8:24 pm
Here is the update of the 3 skins
Update 3 skins.mp4

As can be seen the middel and right one are displayed after the update but the left one fails.
After the update or after the refresh? Because my last posted code using pause/unpause should not have "blank moments", at least it never happened on my system. Or maybe it's because of the resizing of the image from 500x500 to whatever dimensions you have it set there (as they look smaller)?

EDIT: Just tried setting the image to be smaller, at 200x200, and, as expected and as before, I don't even notice when the update happens, so it's not the redimensioning:
Desktop_2020_06_20_23_41_14_394.avi.mp4
P.S. Changed the extension of the file to .mp4 as the forum for some reason doesn't accept .avi files.
You do not have the required permissions to view the files attached to this post.
Last edited by Yincognito on June 20th, 2020, 9:02 pm, edited 1 time in total.
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

First update of the 2 skins.

Top 2 skins are the "Old"skins

Bottom skins are Yincognito code
Update.mp4
So far so good. :thumbup:
I'll monitor it for stability over time
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

JamX wrote:
June 20th, 2020, 9:01 pm
First update of the 2 skins.

Top 2 skins are the "Old"skins

Bottom skins are Yincognito code

Update.mp4

So far so good. :thumbup:
I'll monitor it for stability over time
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
You do not have the required permissions to view the files attached to this post.