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

Animated GIF issue

Help with creating, editing & fixing problems with skins
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 18th, 2020, 7:34 pm
Sorry for the off-topic.
No, no, that was an excellent piece of information - I had no idea of why that happened, just noticed that the 0 delay has an actual delay effect. Many thanks for making this clear, I truly appreciate it. :thumbup:
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 18th, 2020, 7:45 pm
No, no, that was an excellent piece of information - I had no idea of why that happened, just noticed that the 0 delay has an actual delay effect. Many thanks for making this clear, I truly appreciate it. :thumbup:
:thumbup: :great:
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Yincognito wrote:
June 18th, 2020, 7:21 pm
I wasn't able to reproduce the issue, just like the other folks who tried to help you with this, but I believe mak_kawa is correct, some operational timing is the cause of this. You might want to investigate:
- setting a Timeout in the RunCommand measure, to "kill" the task if it somehow continues being active even after the usage period
- make the process clearer and less "overlapping prone" by setting the measures / meters to update "on demand" with the help of the UpdateDivider=-1 & !UpdateMeasure/Meter combo
- make the leading zeros substitute simpler by using something like Substitute="^(.*)$":"0000\1","^.*(.{5})$":"\1"
- better separate the operations in your workflow to avoid their overlapping by using a small delay especially at the start of the FinishAction from MeasureExtract (even a [!Delay 0] produces a delay, despite what one may think due to the "0", i.e. non existent delay period)

Other than that, what I think it happens, given the fact that the entire image dissapears, is either:
- the operations somehow overlap each other at some random intervals
- the image meter is looking for a non-existent image once in a while
- the RunCommand operation doesn't finish properly before the next "session" begins, at various moments
- the image name being looked for is valid, but the contents of the actual .png image file is somehow invalid (unfinished extraction?)
I've made these changes:

Code: Select all

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

[MeasureAnimLoop]
Measure=Calc
Formula=(MeasureAnimLoop % 9) + 1
RegExpSubstitute=1
Substitute="^(.*)$":"0000\1","^.*(.{5})$":"\1"
;Substitute="^(\d\d\d\d)$":"0\1","^(\d\d\d)$":"00\1","^(\d\d)$":"000\1","^(\d)$":"0000\1"
FinishAction=[!Delay 100]
Disabled=1

[MeasureImage]
Measure=Plugin
Plugin=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=[!CommandMeasure MeasureExtract "Run" ][!log "Download"]

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!Delay 100][!SetOption MeterAnimLoop ImageName current[*MeasureAnimLoop*].png][!log "Extract"][!Delay 100][!EnableMeasure MeasureAnimLoop]
Disabled=1

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
DynamicVariables=1
x=0
Y=0
W=534
H=534
PreserveAspectRatio=1
I replaces the substitute like advised.
I added a {!Delay 100] bang at [MeasureExtract] like FinishAction=[!Delay 100][!SetOption MeterAnimLoop ImageName current[*MeasureAnimLoop*].png][!log "Extract"][!Delay 100][!EnableMeasure MeasureAnimLoop]
I added a {!Delay 100] bang at [MeasureAnimLoop] just to be sure
[MeasureExtract] is already "on demand" since Disabled=1

After 7 updates the image disappeared.

After twice pressing the refresh button the images appeared again.
Question: why do I have to press 2 times the refresh button?

Any ideas left?
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 18th, 2020, 9:12 pm
I've made these changes:

Code: Select all

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

[MeasureAnimLoop]
Measure=Calc
Formula=(MeasureAnimLoop % 9) + 1
RegExpSubstitute=1
Substitute="^(.*)$":"0000\1","^.*(.{5})$":"\1"
;Substitute="^(\d\d\d\d)$":"0\1","^(\d\d\d)$":"00\1","^(\d\d)$":"000\1","^(\d)$":"0000\1"
FinishAction=[!Delay 100]
Disabled=1

[MeasureImage]
Measure=Plugin
Plugin=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=[!CommandMeasure MeasureExtract "Run" ][!log "Download"]

[MeasureExtract]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
FinishAction=[!Delay 100][!SetOption MeterAnimLoop ImageName current[*MeasureAnimLoop*].png][!log "Extract"][!Delay 100][!EnableMeasure MeasureAnimLoop]
Disabled=1

[MeterAnimLoop]
Meter=Image
ImagePath=#CURRENTPATH#DownloadFile
DynamicVariables=1
x=0
Y=0
W=534
H=534
PreserveAspectRatio=1
I replaces the substitute like advised.
I added a {!Delay 100] bang at [MeasureExtract] like FinishAction=[!Delay 100][!SetOption MeterAnimLoop ImageName current[*MeasureAnimLoop*].png][!log "Extract"][!Delay 100][!EnableMeasure MeasureAnimLoop]
I added a {!Delay 100] bang at [MeasureAnimLoop] just to be sure
[MeasureExtract] is already "on demand" since Disabled=1

After 7 updates the image disappeared.

After twice pressing the refresh button the images appeared again.
Question: why do I have to press 2 times the refresh button?

Any ideas left?
Regarding the "on demand" thing, a small note: since the measure once enabled stays enabled, it's not exactly what I would call "on demand" (it's only "on demand" at the start). Anyway, that was just to make the workflow clearer and try to make each step of the process happen only after the previous one finished. I'll rewrite the skin tomorrow trying to cover all the angles that I believe could cause the issue you're experiencing, but obviously it's hard to fix something that you can't reproduce for the time being. Since the problem seems to happen after downloading / extracting, I'm not sure how I could increase the update rate of the WebParser (to hopefully reproduce the issue) without polling the site too often and getting blocked / banned / etc, because I wouldn't like to wait for hours until the "bug" finally happens. I could try to work locally instead, but if the whole thing is related to getting the data online, that approach might not prove relevant enough.

Let me see what I can do tomorrow. Now it's past midnight here and while I don't have a problem going deeper in the night in the awake state, so to speak, this has been a busy day for me and I feel like I need some relax time watching some movie or something for a while. :D

By the way, don't give up on this just yet. It's some nice thing you do there in your skin, and setting the update of the skin to lower values (while taking care to avoid a too short update rate in the WebParser) makes the visuals look like watching a live simulation of the atmospheric front movement or the original GIF itself.
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Thanks for your support.
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 18th, 2020, 9:12 pm
I added a {!Delay 100] bang at [MeasureExtract] like FinishAction=[!Delay 100][!SetOption MeterAnimLoop ImageName current[*MeasureAnimLoop*].png][!log "Extract"][!Delay 100][!EnableMeasure MeasureAnimLoop]
I added a {!Delay 100] bang at [MeasureAnimLoop] just to be sure
[MeasureExtract] is already "on demand" since Disabled=1
Although in the code of the FinishAction option, the !Delay bang is used properly, take care not use the bang as have you posted it ({!Delay 100]), but correctly, with brackets: [!Delay 100]. I suppose this was just a typo, but since you've posted it twice the same way maybe it worth a check.
JamX wrote:
June 18th, 2020, 9:12 pm
After 7 updates the image disappeared.
Let's clarify a minor (but probably important) detail: probably the Image meter disappears on the 7th update of the parent WebParser measure, not on the 7th update of the skin, or of the Image meter (not the same thing). Am I right (I suppose so, but just want to make sure)?
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

balala wrote:
June 19th, 2020, 5:58 am
Although in the code of the FinishAction option, the !Delay bang is used properly, take care not use the bang as have you posted it ({!Delay 100]), but correctly, with brackets: [!Delay 100]. I suppose this was just a typo, but since you've posted it twice the same way maybe it worth a check.

Let's clarify a minor (but probably important) detail: probably the Image meter disappears on the 7th update of the parent WebParser measure, not on the 7th update of the skin, or of the Image meter (not the same thing). Am I right (I suppose so, but just want to make sure)?
Yes, my mistake, it was a typo.

Yes update of the parent webparser
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 19th, 2020, 9:44 am
Yes update of the parent webparser
So, the image disappears on the 7th update of the WebParser measure?
User avatar
JamX
Posts: 173
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

balala wrote:
June 19th, 2020, 9:51 am
So, the image disappears on the 7th update of the WebParser measure?
yes, but sometimes it could also be on the 6th or the 2nd
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 19th, 2020, 10:01 am
yes, but sometimes it could also be on the 6th or the 2nd
Weird is that I see nothing which would justify this and for me (and it seems for others as well out there) such problem doesn't exist. I added a simple Calc measure to the code:

Code: Select all

[Measure]
Measure=Calc
Formula=( Measure + 1 )
The value of this measure is increased on every update of the skin (not of the WebParser measure) so with a simple String meter I can see the number of updates. Since the skin has the default Update=1000 option set, the measure is increased once per second, so if I let the skin running, through the above measure I can see the time of running. Right now I already overcame 5400, which means 5400 seconds = cca. 1 hour and a half. Since the WebParser measure has no UpdateRate (nor UpdateDivider) set up, it uses the default UpdateRate=600, which means one update per 10 minutes. So in the 5400 seconds there has been nine updates and the skin is still running with the image visible.
There something strange is going on, I think. Although I'm not sure this gonna help, you might try removing the ForceReload=1 option from the [MeasureImage] measure. Did this help?