It is currently September 7th, 2024, 11:36 pm

Looking for a multi-source picture frame

General topics related to Rainmeter.
User avatar
balala
Rainmeter Sage
Posts: 16499
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Looking for a multi-source picture frame

Post by balala »

Active Colors wrote: June 26th, 2024, 7:39 am I was getting the same experience with Quote measure when I was showing a picture slideshow.
jsmorley gives an explanation to this:


Here is a skin made by jsmorley which specifically targets this described "oddity":
https://forum.rainmeter.net/viewtopic.php?t=15163 (for images)
https://forum.rainmeter.net/viewtopic.php?t=15162 (for texts)

You can also perhaps read through these threads to see and apply the techniques suggested there:
https://forum.rainmeter.net/viewtopic.php?t=26961
https://forum.rainmeter.net/viewtopic.php?t=38583
Not sure what fewer files does mean in the posted quote, however Traxan talked about hundreds of pictures:
Traxan wrote: June 24th, 2024, 6:30 pm I got a problem with this bugger. Despite having a folder with hundreds of pictures to choose from, it regularly and repeatedly picks the the same photos over and over.
:confused:
User avatar
Yincognito
Rainmeter Sage
Posts: 8030
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Looking for a multi-source picture frame

Post by Yincognito »

Traxan wrote: June 24th, 2024, 6:30 pm I got a problem with this bugger. Despite having a folder with hundreds of pictures to choose from, it regularly and repeatedly picks the the same photos over and over. I see the same pictures over and over while others are never or rarely show. There's nothing in the code to explain such favoritism, so what else could it be?
Yincognito wrote: June 26th, 2024, 3:15 pmI do have a FolderInfo/ FileView / Random Calc version written and functioning, but didn't post it yet since sometimes it returns no image (i.e. a black output), which might indicate some slight timing issue between reading from drive and showing the result. Once that is solved, I'll share it here, maybe it helps. In the meantime, the Lua variants can of course be tested, though personally I don't see Lua an absolute necessity in this case.
So, first, here's an improved version of the earlier code, it has scaling and some tooltip details on hover, but will exhibit the same random issue:

Code: Select all

[Variables]
Width=160
Height=90
Border=2
Scale=1
Step=0.1
InfoTime=300
ViewTime=1
ImageCount=3
ImagePath1=f:\Images\Cars\Wallpapers\Unprocessed\000000001
SubFolders1=0
FileFilter1=*.jpg;*.jpeg;*.png;*.bmp;*.gif
ImagePath2=f:\Images\Cars\Wallpapers\Unprocessed\000000002
SubFolders2=0
FileFilter2=*.jpg;*.jpeg;*.png;*.bmp;*.gif
ImagePath3=f:\Images\Cars\Wallpapers\Unprocessed\000000003
SubFolders3=0
FileFilter3=*.jpg;*.jpeg;*.png;*.bmp;*.gif

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

---Measures---

[Path1Image]
Measure=Plugin
Plugin=QuotePlugin
PathName=#ImagePath1#
FileFilter=#FileFilter1#
Subfolders=#SubFolders1#
UpdateDivider=#ViewTime#

[Path2Image]
Measure=Plugin
Plugin=QuotePlugin
PathName=#ImagePath2#
FileFilter=#FileFilter2#
Subfolders=#SubFolders2#
UpdateDivider=#ViewTime#

[Path3Image]
Measure=Plugin
Plugin=QuotePlugin
PathName=#ImagePath3#
FileFilter=#FileFilter3#
Subfolders=#SubFolders3#
UpdateDivider=#ViewTime#

[FinalImage]
Measure=Calc
Formula=Random
LowBound=1
HighBound=#ImageCount#
UpdateRandom=1
UpdateDivider=#ViewTime#
RegExpSubstitute=1
Substitute="^(\d+)$":"Path\1Image"
DynamicVariables=1

---Meters---

[Background]
Meter=Shape
Shape=Rectangle (#Border#/2*#Scale#),(#Border#/2*#Scale#),((#Width#+#Border#)*#Scale#),((#Height#+#Border#)*#Scale#) | Fill Color 0,0,0,255 | StrokeWidth (#Border#*#Scale#) | StrokeColor 255,255,255,75
UpdateDivider=-1
DynamicVariables=1

[Slideshow]
Meter=Image
X=(#Border#*#Scale#)
Y=(#Border#*#Scale#)
W=(#Width#*#Scale#)
H=(#Height#*#Scale#)
PreserveAspectRatio=1
MeasureName=[FinalImage]
UpdateDivider=#ViewTime#
MouseScrollUpAction=[!SetVariable Scale (Clamp(#Scale#+#Step#,0.5,10))][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Scale (Clamp(#Scale#-#Step#,0.5,10))][!UpdateMeter *][!Redraw]
LeftMouseUpAction=["[#ImagePath[&FinalImage:]]"]
TooltipTitle=[FinalImage:]) [&[&FinalImage]]
TooltipText=1) [Path1Image]#CRLF#2) [Path2Image]#CRLF#3) [Path3Image]
DynamicVariables=1
Secondly, as promised, here's the FolderInfo / FileView alternative, featuring the same things as the first, but without the random issue:

Code: Select all

[Variables]
Width=160
Height=90
Border=2
Scale=1
Step=0.1
InfoTime=300
ViewTime=1
ImageCount=3
PathIndex=1
FileIndex=1
ImagePath1=f:\Images\Cars\Wallpapers\Unprocessed\000000001
SubFolders1=0
FileFilter1=(?i)^.*[.](?:jpg|jpeg|png|bmp|gif)$
ImagePath2=f:\Images\Cars\Wallpapers\Unprocessed\000000002
SubFolders2=0
FileFilter2=(?i)^.*[.](?:jpg|jpeg|png|bmp|gif)$
ImagePath3=f:\Images\Cars\Wallpapers\Unprocessed\000000003
SubFolders3=0
FileFilter3=(?i)^.*[.](?:jpg|jpeg|png|bmp|gif)$
FileFilterAll=jpg;jpeg;png;bmp;gif

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

---Measures---

[Path1Count]
Measure=Plugin
Plugin=FolderInfo
Folder=#ImagePath1#
InfoType=FileCount
IncludeSubFolders=#SubFolders1#
RegExpFilter=#FileFilter1#
UpdateDivider=#InfoTime#

[Path2Count]
Measure=Plugin
Plugin=FolderInfo
Folder=#ImagePath2#
InfoType=FileCount
IncludeSubFolders=#SubFolders2#
RegExpFilter=#FileFilter2#
UpdateDivider=#InfoTime#

[Path3Count]
Measure=Plugin
Plugin=FolderInfo
Folder=#ImagePath3#
InfoType=FileCount
IncludeSubFolders=#SubFolders3#
RegExpFilter=#FileFilter3#
UpdateDivider=#InfoTime#

[FinalNumber]
Measure=Calc
Formula=Random
LowBound=1
HighBound=([Path1Count]+[Path2Count]+[Path3Count])
UpdateRandom=1
UpdateDivider=#ViewTime#
OnUpdateAction=[!SetVariable PathIndex ([FinalNumber]-0>[Path1Count]?([FinalNumber]-[Path1Count]>[Path2Count]?3:2):1)][!SetVariable FileIndex ([FinalNumber]-0>[Path1Count]?([FinalNumber]-[Path1Count]>[Path2Count]?[FinalNumber]-[Path1Count]-[Path2Count]:[FinalNumber]-[Path1Count]):[FinalNumber])][!SetOption FinalFolder Path "[#ImagePath[#PathIndex]]"][!SetOption FinalImage Index [#FileIndex]][!UpdateMeasureGroup Final][!CommandMeasure FinalFolder "Update"]
DynamicVariables=1

[FinalFolder]
Group=Final
Measure=Plugin
Plugin=FileView
Path=
ShowDotDot=0
ShowFolder=0
ShowHidden=0
ShowSystem=0
HideExtensions=0
Recursive=2
Extensions=#FileFilterAll#
FinishAction=[!UpdateMeter *][!Redraw]
UpdateDivider=-1
DynamicVariables=1

[FinalImage]
Group=Final
Measure=Plugin
Plugin=FileView
Path=[FinalFolder]
Type=FilePath
Index=
IgnoreCount=1
UpdateDivider=-1
DynamicVariables=1

---Meters---

[Background]
Meter=Shape
Shape=Rectangle (#Border#/2*#Scale#),(#Border#/2*#Scale#),((#Width#+#Border#)*#Scale#),((#Height#+#Border#)*#Scale#) | Fill Color 0,0,0,255 | StrokeWidth (#Border#*#Scale#) | StrokeColor 255,255,255,75
UpdateDivider=-1
DynamicVariables=1

[Slideshow]
Meter=Image
X=(#Border#*#Scale#)
Y=(#Border#*#Scale#)
W=(#Width#*#Scale#)
H=(#Height#*#Scale#)
PreserveAspectRatio=1
MeasureName=FinalImage
UpdateDivider=-1
MouseScrollUpAction=[!SetVariable Scale (Clamp(#Scale#+#Step#,0.5,10))][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Scale (Clamp(#Scale#-#Step#,0.5,10))][!UpdateMeter *][!Redraw]
LeftMouseUpAction=["[#ImagePath[#PathIndex]]"]
TooltipTitle=#PathIndex#) #FileIndex#) [FinalImage] <[FinalNumber]>
TooltipText=1) #ImagePath1# <[Path1Count]>#CRLF#2) #ImagePath2# <[Path2Count]>#CRLF#3) #ImagePath3# <[Path3Count]>
DynamicVariables=1
Feel free to adjust the paths and ViewTime / InfoTime to your own, make sure FileFilterAll is equivalent to the previous 3 FileFilters if you change them, or ask for an explanation if you didn't understand how it works and want to find out. If you wonder, the things in the OnUpdateAction take advantage of numeric conditionals (also known as the ternary operator in other languages) to convert the multi-folder random [FinalNumber] into the corresponding single-folder equivalents used to choose the displayed image.

P.S. In the end, the blank result I was getting earlier was simply because I forgot to use the nested syntax for the FileIndex variable in the OnUpdateAction.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth