It is currently July 14th, 2020, 8:44 pm

Animated GIF issue

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

Re: Animated GIF issue

Post by balala »

JamX wrote:
June 29th, 2020, 8:39 am
The next update is the opposite, the rain png are not correct

The next update(s) all is working perfectly.
Not entirely follow these: is it working well, or not?
For me the last posted skin is working. Didn't let it too long, but as long as I left, it did work:
GIF.gif
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 156
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

balala wrote:
June 29th, 2020, 1:49 pm
Not entirely follow these: is it working well, or not?
For me the last posted skin is working. Didn't let it too long, but as long as I left, it did work:
GIF.gif
No it's still NOK.

The skin worked with only the rain radar.
Then I added the Lightning radar code to it and it get stuck
Then I adjusted the coding from Yincognito with the "Update" suggestion and the code did not get stuck anymore
Only thing my 'special computer' now has is the fact that after the extraction some png file are "corrupted' or something like that.
Maybe due to overlapping gif2frames.exe executions but Even when I put in Delay=5000 it still does not work as it was intended.
error.mp4
after 1st update:
Capture.JPG
Try to simulate as I did. First remove all the current.gif and png files from the download directory.
Then Load the skin and see what happens in the download directory during the process
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote:
June 29th, 2020, 3:54 pm
No it's still NOK.
I'm just waiting to fill an entire log page with the "rewritten" code I promised yesterday - stay tuned. By the way, you'll see, once I post the screenshot of it working on my system, that it has no problems when some other program is downloading around 6 MB/s - no freeze, no delays, no issues whatsoever. Of course, the real test will be on your system, since apparently there are some differences between the results of our tests in your case vs mine and balala's. Who knows, maybe our connection is better? :confused:
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote:
June 29th, 2020, 3:54 pm
No it's still NOK.

The skin worked with only the rain radar.
Then I added the Lightning radar code to it and it get stuck
Then I adjusted the coding from Yincognito with the "Update" suggestion and the code did not get stuck anymore
Only thing my 'special computer' now has is the fact that after the extraction some png file are "corrupted' or something like that.
Maybe due to overlapping gif2frames.exe executions but Even when I put in Delay=5000 it still does not work as it was intended.

Try to simulate as I did. First remove all the current.gif and png files from the download directory.
Then Load the skin and see what happens in the download directory during the process
Ok, here is the code I used in my tests (based on your initial version of "RadarPlus", not the second one you posted). Don't forget to set back the UpdateWebParser to 600 or as many seconds you want it to be, and to uncomment back the X and Y lines from [MeterBackground] if you like (I commented them as they prevented me from moving the skin upwards on the screen, but for your integration in the other skin they might serve a purpose, after all):

Code: Select all

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

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

UpdateInterval=1000
UpdateWebParser=60
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 "Rain Download Finished"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtract "Run"]
OnConnectErrorAction=[!Log "Rain Connection Error"][!Delay #Delay#][!PauseMeasure "MeasureAnimLoop"][!CommandMeasure MeasureExtract "Run"]
OnDownloadErrorAction=[!Log "Rain 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 "Rain Extraction Finished"][!Delay #Delay#][!EnableMeasure "MeasureImageLight"][!CommandMeasure  MeasureImageLight "Update"]
DynamicVariables=1

[MeasureImageLight]
Disabled=1
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=0&skip=1
Download=1
DownloadFile=current.gif
ForceReload=1
UpdateRate=-1
UpdateDivider=(#UpdateWebParser#*1000/#UpdateInterval#)
FinishAction=[!Log "Light Download Finished"][!Delay #Delay#][!CommandMeasure MeasureExtractLight "Run"]
OnConnectErrorAction=[!Log "Light Connection Error"][!Delay #Delay#][!CommandMeasure MeasureExtractLight "Run"]
OnDownloadErrorAction=[!Log "Light Download Error"][!Delay #Delay#][!CommandMeasure MeasureExtractLight "Run"]
DynamicVariables=1

---Measures RunCommand---

[MeasureExtractLight]
Measure=Plugin
Plugin=RunCommand
Parameter=gif2frames.exe current.gif
StartInFolder=#CURRENTPATH#DownloadFile
State=Hide
OutputType=ANSI
Timeout=5000
FinishAction=[!Log "Light Extraction Finished"][!Delay #Delay#][!UnpauseMeasure MeasureAnimLoop]
DynamicVariables=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
The results - no issues, despite the otherwise > 4.5 MB/s download rate, visible in my skins at the top:
RadarPlusFinal.jpg
The results after your image removal suggestion - no issues after 3 updates, didn't wait for longer as the status was clear:
RadarPlusFinal (Removal Test).jpg
Let me know if it works in your case. Hopefully the results will be as good as the last time you used my version of the code. ;-)
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 156
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Nope, did not work, same as I had, even a bit worse .
Look at the video.
I have clipped the video so it's below 2mb but you'll see 3 updates.
test.mp4
I don't even understand where that "PAUSE" cam from. Looking at the code it should not happen
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote:
June 29th, 2020, 5:29 pm
Nope, did not work, same as I had, even a bit worse .
Look at the video.
I have clipped the video so it's below 2mb but you'll see 3 updates.
test.mp4

I don't even understand where that "PAUSE" cam from. Looking at the code it should not happen
I have no idea why that happens either. Since for me it works without any kind of issues, it's a bit hard (to put it mildly) to "fix" what simply doesn't happen in my case. I would very much like to help you further with this, but I'm sort of blindfolded now with the issue you have. Maybe balala will come up with a suggestion, something that maybe has been missed by both of us? :confused:

One other thing: try to test this first without any other skin loaded, just the code I posted, and without the explorer open in the image folder. Who knows, maybe something else is "locking" some of the image files somehow? The operations are otherwise separated and happen as sequentially as possible, so there shouldn't be any issue there... :???:
User avatar
JamX
Posts: 156
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

Yes, you are right.

I also can not comprehend why this Sh#t is happening on my system only.

Also with NO explorer open it is still the same.

It's not that I have a "slow" network connection
Capture.JPG
You do not have the required permissions to view the files attached to this post.
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

JamX wrote:
June 29th, 2020, 6:12 pm
Yes, you are right.

I also can not comprehend why this Sh#t is happening on my system only.

Also with NO explorer open it is still the same.

It's not that I have a "slow" network connection
Capture.JPG
Yeah, indeed. Just tested with the explorer window open to see the "changes" like in your videos (as I almost never open Explorer otherwise, I use another file manager), and besides one single very short "update" of current.gif that happened only once while looking at it, it's like the download/extraction never happens, I'm not seeing any "no image" icons at any time in the Explorer window. So it either happens very fast and I don't get the chance to see it, or my explorer doesn't "auto-refresh" itself like in your videos.

EDIT: Another thing that you could do in the hope that it could provide some clarification on the issue is to temporarily disable your antivirus and/or firewall for a short time while testing, or even to try to run the skin in Safe Mode (assuming Rainmeter works properly in that mode, as I never tried) and see if the issue persists. That's a shot in the dark, but really, it's my last idea on the topic, I can't see what I could think of otherwise.
User avatar
Yincognito
Posts: 1936
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Animated GIF issue

Post by Yincognito »

Ok, some (I believe, good) idea of a workaround, after looking through the page source of buienradar.nl - there is a way of getting all the frames, at least for the "rain" part (I did use Google Translate to try to find where the lightning images are displayed on the site without any luck), by using something like:

Code: Select all

https://image.buienradar.nl/2.0/image/sprite/RadarMapRainNL?extension=png&width=550&height=512&renderText=True&renderBranding=False&renderBackground=True&history=3&forecast=12&skip=0
as the URL (parameters in the query are obviously adjustable). It will yield a 15-frame single PNG image like the one below, that you can display individual frames from using a Bitmap meter:
202006291925__550x512_True_False_True_3_12_0_0_0.png
There was a timestamp part that could be added to the URL above (something like &timestamp=202006291915&202006291912), but I removed it as I couldn't figure out its principle, not to mention the address worked fine without it.
This allows one to make a single WebParser request from the site and doesn't require using gif2frames.exe to further extract the frames from a GIF that's already assembled on the fly by the site. Now if such a solution was available for the lightning part, that would probably workaround the entire issue permanently, as you'd only have to download 2 multiple-frame PNGs which you could then display frames from at your choosing. Even with just the rain part, it still means that you won't have to use gif2frames.exe and you'll be able to get rid of the extraction part for one of the areas that you want the info displayed for.

EDIT: My bad, the lightning part is just as easy to get with:

Code: Select all

https://image.buienradar.nl/2.0/image/sprite/RadarMapLightningNL?extension=png&width=550&height=512&renderText=True&renderBranding=False&renderBackground=True&history=3&forecast=12&skip=0
yielding:
202006291955__550x512_True_False_True_3_0_0_0_0.png
EDIT 2: There is a drawback for the above method though, unfortunately: you can't use W and H on the Bitmap meter, but fortunately you can control the frame dimensions by modifying the width and height parameters in the URL(s), like this:

Code: Select all

https://image.buienradar.nl/2.0/image/sprite/RadarMapRainNL?extension=png&width=232&height=232&renderText=True&renderBranding=False&renderBackground=True&history=3&forecast=12&skip=0
and this:

Code: Select all

https://image.buienradar.nl/2.0/image/sprite/RadarMapLightningNL?extension=png&width=232&height=232&renderText=True&renderBranding=False&renderBackground=True&history=3&forecast=12&skip=0
which will make frames 232 x 232 in the downloaded PNG(s) themselves.

I think now everybody can be happy, the issue is likely solved, only the Bitmap meter implementation is missing, but it shouldn't be a problem for you, right, JamX? If it is, help is a click away anyway. 8-)
You do not have the required permissions to view the files attached to this post.
User avatar
JamX
Posts: 156
Joined: October 4th, 2019, 2:46 pm

Re: Animated GIF issue

Post by JamX »

I'll give it a try tomorrow.

Thanks for the hint. :thumbup: