It is currently May 8th, 2024, 4:20 pm

Webparser - Display multiple images more efficient

Get help with creating, editing & fixing problems with skins
jwoodard80
Posts: 5
Joined: April 24th, 2014, 2:44 pm

Webparser - Display multiple images more efficient

Post by jwoodard80 »

I have a cronjob that uploads to snapshot images from my NVR to a VPS every 5 min. They are all statically named (IE: Driveway.jpg, Kitchen.jpg, etc...) and the location doesn't change. There is no HTML, just a folder with images. Currently I have the below skin that updates and displays them in a grid. It works great! No problem...except it uses about 80mb of my resource and this seems a little high.

This may be normal, however, i'm hoping someone might give me some pointers to possibly make it a bit more efficient on resources. I'm open to most any suggestion. I made something that works, just hoping to make it better and learn.

Forgive me if this is a common question. I just didn't find anything in my limited search.

Thanks in advance.

------ SKIN BELOW ------

Code: Select all

[Rainmeter]
DynamicWindowSize=1
Update=1000

[Measure12HrTime]
Measure=Time
Format=%#I:%M:%S %p

[MeterString]
Meter=String
MeasureName=Measure12HrTime
Text="Home NVR Snapshots -- %1"
SolidColor=0,0,0,1
AntiAlias=1
FontColor=130,130,130
FontFace=Book Antiqua
FontSize=20

[DrivewayImage]
Measure=Plugin
Plugin=Webparser
Url=http://someplace.somewhere.com/snaps/Driveway.jpg
Download=1
UpdateRate=60

[FrontDoorImage]
Measure=Plugin
Plugin=Webparser
Url=http://someplace.somewhere.com/snaps/FrontDoor.jpg
Download=1
UpdateRate=60

[LivingRoomImage]
Measure=Plugin
Plugin=Webparser
Url=http://someplace.somewhere.com/snaps/LivingRoom.jpg
Download=1
UpdateRate=60

[GarageImage]
Measure=Plugin
Plugin=Webparser
Url=http://someplace.somewhere.com/snaps/Garage.jpg
Download=1
UpdateRate=60

[Child1BedroomImage]
Measure=Plugin
Plugin=Webparser
Url=http://someplace.somewhere.com/snaps/Child1.jpg
Download=1
UpdateRate=60

[Child2BedroomImage]
Measure=Plugin
Plugin=Webparser
Url=http://someplace.somewhere.com/snaps/Child2.jpg
Download=1
UpdateRate=60

[KitchenImage]
Measure=Plugin
Plugin=Webparser
Url=http://someplace.somewhere.com/snaps/Kitchen.jpg
Download=1
UpdateRate=60

[ShopImage]
Measure=Plugin
Plugin=Webparser
Url=http://someplace.somewhere.com/snaps/Shop.jpg
Download=1
UpdateRate=60


;; --------------- Image Display--------------

[DisplayDriveway] ; row 1 right
Meter=IMAGE
y=40r
MeasureName=DrivewayImage
W=400
PreserveAspectRatio=1
SolidColor=000000

[DisplayChild1Bedroom] ; row 1 left
Meter=IMAGE
x=401r
y=0r
MeasureName=Child1BedroomImage
W=400
PreserveAspectRatio=1
SolidColor=000000

[DisplayFrontDoor] ; row 2 left
Meter=IMAGE
y=226r
MeasureName=FrontDoorImage
W=400
PreserveAspectRatio=1
SolidColor=000000

[DisplayChild2Bedroom] ; row 2 right
Meter=IMAGE
x=401r
y=0r
MeasureName=Child2BedroomImage
W=400
PreserveAspectRatio=1
SolidColor=000000

[DisplayLivingRoom] ; row 3 left
Meter=IMAGE
y=226r
MeasureName=LivingRoomImage
W=400
PreserveAspectRatio=1
SolidColor=000000

[DisplayKitchen] ; row 3 right
Meter=IMAGE
x=401r
y=0r
MeasureName=KitchenImage
W=400
PreserveAspectRatio=1
SolidColor=000000

[DisplayGarage] ; row 4 left
Meter=IMAGE
y=226r
MeasureName=GarageImage
W=400
PreserveAspectRatio=1
SolidColor=000000

[DisplayShop] ; row 4 right
Meter=IMAGE
x=401r
y=0r
MeasureName=ShopImage
W=400
PreserveAspectRatio=1
SolidColor=000000
Last edited by jsmorley on November 20th, 2018, 3:27 pm, edited 3 times in total.
Reason: Please use [code] tags on long code snippets. It's the </> button.
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Webparser - Display multiple images more efficient

Post by CyberTheWorm »

Personally I would save the images to your hard drive and then get rid of all the Webparser measures. I would only use Webparser if I could not access the images any other way.
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
balala
Rainmeter Sage
Posts: 16204
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Webparser - Display multiple images more efficient

Post by balala »

CyberTheWorm wrote: November 20th, 2018, 4:48 pm Personally I would save the images to your hard drive and then get rid of all the Webparser measures. I would only use Webparser if I could not access the images any other way.
This is exactly what has been done: the WebParser measures download the appropriate images, then the Image meters show them. How often the WebParser measures re-download the images depends on their UpdateRate option. Here these operations go on once per minut (due to the UpdateRate=60 options set up on all WebParser measures), I probably would increase them, but I doubt there would be something else to be done.
However I see one problem in the posted code: unlike in programming languages, in Rainmeter you shouldn't have to put the comments in the same line as any option or section name (particularly here in the same line as the meter names). See my Tip here AND especially jsmorley's next post.
User avatar
jsmorley
Developer
Posts: 22631
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Webparser - Display multiple images more efficient

Post by jsmorley »

If the images are static and unchanging, then yeah, WebParser isn't needed. Just download them and store them locally in @Resources with the skin.

If the images are not static and unchanging, then the only way to do this is with WebParser.

In both cases, the amount of memory resources used will be more or less the same. Rainmeter will "cache" any images that you load into an Image meter, so whether you store them locally in @Resources, or WebParser temporarily stores them in %TEMP%, the result on memory is the same. At the end of the day, they are loaded from a local file in either case.
jwoodard80
Posts: 5
Joined: April 24th, 2014, 2:44 pm

Re: Webparser - Display multiple images more efficient

Post by jwoodard80 »

Awesome! This was exactly the feedback I was looking for. If there is nothing to be done (minus the comments) then that is the answer. I just wanted to make sure there something I was doing incorrectly to cause issues and you all answered that!