It is currently October 3rd, 2024, 11:12 pm

ImageSize 4.0

Plugins and Addons popular with the Community
User avatar
jsmorley
Developer
Posts: 22802
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: ImageSize 4.0

Post by jsmorley »

Edit: February 18, 2019: Version 4.0 released to fix an issue where the plugin measure would not respond properly to being "Disabled" or "Paused".

.rmskin and separate .zip available in the first post of this thread.
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: ImageSize 4.0

Post by Youkai1977 »

I'm on the fence about this plugin right now.
Can it be that it has a BUG, or am I (only once again) too blond in the head to understand this whole syntax?

If I have this Plugin in my slideshow, it works fine.
But woe I still add the following things, such as from the following link:
- https://forum.rainmeter.net/viewtopic.php?t=21112
...which contains among other things in the download a sample slideshow with fade function when changing images.
Then the ImageSize PlugIn is NOT able to position the image correctly.
It is then shifted in the Y-axis exactly by the value upwards, which the PlugIn should actually move the image in the Y-axis downwards.

Or 2nd example:
I have tinkered a toggle function for the ImageTint in the SlideShow. And look, despite my poor Rainmeter knowledge, my idea to do it via a changeable variable, which again checks a measure for 0 or 1 and then sets via !SetOption in the slideshow meter the value "ImageTint" accordingly and then via !UpdateMeter and !UpdateMeasure with final !Redraw me all necessary measure and meter with the new ImageTint value updated totally super. The images in the slideshow immediately have the new ImageTint value.
BUT NOW AGAIN ... this §$%&#* - ImageSize plugin .... :x :twisted:
3 guesses what it does?! Exactly the same crap as from my first example. It shifts the image in the Y-axis by the value upwards, which it should actually shift downwards. Even a complete !refresh command of the whole slideshow, or refreshing by right clicking with the mouse and then clicking on "refresh skin" does nothing.
But if I set the ImageTint value back to 1, i.e. from 255,255,255,255 (0 = ImageTint off) to my desired color value 97,240,255,230 ...yes then the image is shifted correctly in the Y-axis again.

In short, as mentioned at the beginning, am I too stupid to understand something here, or does the ImageSize PlugIn have a BUG?
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
balala
Rainmeter Sage
Posts: 16623
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ImageSize 4.0

Post by balala »

Youkai1977 wrote: February 27th, 2021, 3:08 am But woe I still add the following things, such as from the following link:
- https://forum.rainmeter.net/viewtopic.php?t=21112
...which contains among other things in the download a sample slideshow with fade function when changing images.
Then the ImageSize PlugIn is NOT able to position the image correctly.
It is then shifted in the Y-axis exactly by the value upwards, which the PlugIn should actually move the image in the Y-axis downwards.
The skins of the posted package have nohing to do with the ImageSize plugin, neither ImageFader.ini, nor the others. So i suppose you have rewrote some thing there. A posted code would be useful in order to can tell something relevant.
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: ImageSize 4.0

Post by Youkai1977 »

balala wrote: February 27th, 2021, 7:35 am The skins of the posted package have nohing to do with the ImageSize plugin, neither ImageFader.ini, nor the others. So i suppose you have rewrote some thing there. A posted code would be useful in order to can tell something relevant.

Code: Select all

Rainmeter]
Update=1000

[Variables]
Alpha1=1
Alpha2=255
W=80
U=[!UpdateMeasure MeasureFadeBetween][!UpdateMeterGroup BothImages][!Redraw]
; Set variables below as you like
PathName=F:\BILDER\Bilder (PRIVAT)\Robin\00 Robin (Rainmeter)
SecondsBetween=10
ImgWidth=436
ImgHeight=246
BorderSize=10
BorderColor=37,47,57,255

[MeasureImage1]
Measure=Plugin
Plugin=QuotePlugin
PathName=#PathName#
Subfolders=1
FileFilter=*.jpg;*.png;*.bmp;*.gif
OnUpdateAction=[!EnableMeasureGroup mSiPo][!UpdateMeasureGroup mSiPo]
UpdateDivider=-1

[MeasureImage2]
Measure=String
String=[MeasureImage1]
DynamicVariables=1
UpdateDivider=-1

[mWidth]
Measure=PLUGIN
Plugin=ImageSize
ImageName=[MeasureImage1]
Dimension=Width
DynamicVariables=1
UpdateDivider=-1
Disabled=1
Group=mSiPo

[mHeight]
Measure=PLUGIN
Plugin=ImageSize
ImageName=[MeasureImage1]
Dimension=Height
DynamicVariables=1
UpdateDivider=-1
Disabled=1
Group=mSiPo

[mYPosition]
Measure=CALC
Formula=Round((#ImgHeight#-(mHeight/(mWidth/#ImgWidth#)))*0.5)
UpdateDivider=-1
Disabled=1
Group=mSiPo

[MeasureTimer]
Measure=Calc
Formula=(MeasureTimer % #SecondsBetween#) + 1
IfCondition=MeasureTimer=#SecondsBetween#
IfTrueAction=[!CommandMeasure MeasureFadeBetween "Execute 1"]

[MeasureFadeBetween]
Measure=Plugin
Plugin=ActionTimer
ActionList1=Update1|Wait 1|SetMeters|Wait 1|Repeat Fade2To1,#W#,12|Wait 1|Copy1To2|Wait 1|ResetAlpha
Update1=[!UpdateMeasure MeasureImage1]
SetMeters=[!SetOptionGroup BothMeters MeasureName ""][!SetOption MeterImage1 ImageName "[MeasureImage1]"][!SetOption MeterImage2 ImageName "[MeasureImage2]"]#U#
Fade2To1=[!SetVariable Alpha2 "(Clamp(#Alpha2#-25,1,255))"][!SetVariable Alpha1 "(Clamp(#Alpha1#+25,1,255))"]#U#
Copy1To2=[!UpdateMeasure MeasureImage2]
ResetAlpha=[!SetVariable Alpha1 "1"][!SetVariable Alpha2 "255"]
DynamicVariables=1

[MeterBorder]
Meter=Image
X=0
Y=0
W=(#ImgWidth# + #BorderSize#)
H=(#ImgHeight# + #BorderSize#)
SolidColor=#BorderColor#

[MeterImage1]
Meter=Image
Group=BothImages
MeasureName=MeasureImage1
X=(#BorderSize#/2)r
Y=((#BorderSize#/2) + [mYPosition])
W=#ImgWidth#
H=#ImgHeight#
PreserveAspectRatio=2
ImageAlpha=#Alpha1#
DynamicVariables=1
UpdateDivider=-1

[MeterImage2]
Meter=Image
Group=BothImages
MeasureName=MeasureImage2
X=(#BorderSize#/2)r
Y=((#BorderSize#/2) + [mYPosition])
W=#ImgWidth#
H=#ImgHeight#
PreserveAspectRatio=2
ImageAlpha=#Alpha2#
DynamicVariables=1
UpdateDivider=-1
LeftMouseUpAction=["[MeasureImage2]"]
That the ActionTimer (ImageFader.ini) has nothing to do with the ImageSize plugin is clear to me.
But here is my rewritten ImageFader.ini for testing, which now also serves the ImageSize plugin.

I would upload my actual SlideShow (from this posting -> https://forum.rainmeter.net/viewtopic.php?p=188443#p188443), but it has changed quite a bit since then. It is (still) under construction and currently a large construction site with the 1400 lines distributed over 2 files.
Nobody would see through that now.

So here is the ImageFader.ini I rewrote for test purposes, which has exactly the same error as my large construction site slideshow.

And the same error occurs when I include (ALSO or ONLY) my toggle ImageTint function as mentioned in the opening post. ALSO WITHOUT the ImageFader.ini code example. Which actually only changes the color value of the "ImageTint" value in the slideshow meter and not any coordinate values, like Y,X or W,H values.
PS.: This function is NOT included in the ImageFader rewritten here as an example.
You do not have the required permissions to view the files attached to this post.
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: ImageSize 4.0

Post by Youkai1977 »

Ok, I seem to have found the solution.
Namely, I have the formula in the measure [mYPosition] of:
- Original from Example: Formula=Round((#ImgHeight#-(mHeight/(mWidth/#ImgWidth#)))*0.5)

in...

- My solution 1: Formula=Round((#ImgHeight# - (mHeight/(mWidth/#ImgWidth#))*0.5)

...changed and already the thing runs.

Now I don't know exactly if the original Formula from the ImageFade.ini is in Part [...] #ImgWidth#)))*0.5) a ")" bracket to much is, so an error. However, I'm kind of lost as far as the brackets are concerned, I'm not Einstein and I'm losing sight of the mathematical logic here.

In solution 1, one bracket is too few (to my knowledge) and it still works WITHOUT an error message from Rainmeter.
In the original, all brackets (again, if my math knowledge to brackets after over 26 years from school are still good enough) are correct in number, and it works but so NOT.
Or whether I as already often mentioned, here in the think/find error by my modest knowledge in relation to formulas for Rainmeter often do not see/find the error/solution ... in short, the proverbial forest for many trees not.
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
balala
Rainmeter Sage
Posts: 16623
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ImageSize 4.0

Post by balala »

Youkai1977 wrote: February 27th, 2021, 12:15 pm - Original from Example: Formula=Round((#ImgHeight#-(mHeight/(mWidth/#ImgWidth#)))*0.5)

in...

- My solution 1: Formula=Round((#ImgHeight# - (mHeight/(mWidth/#ImgWidth#))*0.5)

...changed and already the thing runs.
The original formula seems correct. The parentheses are in pair: Formula=Round((#ImgHeight#-(mHeight/(mWidth/#ImgWidth#)))*0.5). But in your last posted formula a closing parenthese is missing, the the red one has no pair: Formula=Round((#ImgHeight# - (mHeight/(mWidth/#ImgWidth#))*0.5). As such, I doubt this formula is working. It is returning always 0, isn't it?
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: ImageSize 4.0

Post by Youkai1977 »

balala wrote: February 27th, 2021, 3:14 pm The original formula seems correct. The parentheses are in pair: Formula=Round((#ImgHeight#-(mHeight/(mWidth/#ImgWidth#)))*0.5). But in your last posted formula a closing parenthese is missing, the the red one has no pair: Formula=Round((#ImgHeight# - (mHeight/(mWidth/#ImgWidth#))*0.5). As such, I doubt this formula is working. It is returning always 0, isn't it?
Correct in the V-Shift is now always "0" but the image is displayed to me (no matter what format or resolution/size) nicely centered in the slideshow without bars at the top and/or bottom.
Hence my confusion. That my formula can not be correct I have already thought.
And what I do not want to understand at all, if I take the correct formula and combine it with the example "ImageFader.ini", then the positioning of the image in the Y-axis does NOT work. :confused:
Just as little if I change the color of the ImageTint per exchangeable variable.

Where and how or here the connections are I just do not understand. Actually, the calculation of the image position in the Y-axis has nothing to do with an ImageTint color change.
At most with the ImageSize, there I see a certain connection there with 2 meters is worked in each case a picture indicate, which can have for itself picture contents with different resolutions.
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
balala
Rainmeter Sage
Posts: 16623
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ImageSize 4.0

Post by balala »

Youkai1977 wrote: February 27th, 2021, 4:10 pm Correct in the V-Shift is now always "0" but the image is displayed to me (no matter what format or resolution/size) nicely centered in the slideshow without bars at the top and/or bottom.
Hence my confusion. That my formula can not be correct I have already thought.
And what I do not want to understand at all, if I take the correct formula and combine it with the example "ImageFader.ini", then the positioning of the image in the Y-axis does NOT work. :confused:
Just as little if I change the color of the ImageTint per exchangeable variable.

Where and how or here the connections are I just do not understand. Actually, the calculation of the image position in the Y-axis has nothing to do with an ImageTint color change.
At most with the ImageSize, there I see a certain connection there with 2 meters is worked in each case a picture indicate, which can have for itself picture contents with different resolutions.
I'd try to set the [MeterImage1] and [MeterImage2] meters to X=0 and Y=0.
User avatar
Youkai1977
Posts: 164
Joined: October 31st, 2018, 4:11 pm
Location: Germany

Re: ImageSize 4.0

Post by Youkai1977 »

balala wrote: February 27th, 2021, 6:27 pm I'd try to set the [MeterImage1] and [MeterImage2] meters to X=0 and Y=0.
No, that's not the reason either. Thanks for the idea anyway.

I have found the error but probably ... a simple but really stupid mistake on my part. I told you, I can't see the forest anymore... :? :???:

Namely, I have specified a H= in the ImageMeters.
In my SlideShow, as now in the here posted rebuilt ImageFade.ini.
And that must not. I noticed it when I had commented out the container in Notepad++ as a test.
Now it works, and has as suspected by you and also by me nothing to do with the brackets in the formula of the [mYPosition].
In short, the error was already so obvious that it was already invisible again ... or so...

But what I still don't understand is, why in my actual slideshow the error wasn't there all the time, so the image was always correct in the Y-axis according to V-Shift, nevertheless that I erroneously had a H= specification in it. And occurred only when I tried to implement the fade function, or now also my on replaceable ImageTint variable?
As I said, the color value variable has nothing to do with an X,Y or W,H value?
This is just the riddle of the year for me. This is also the reason for my question in the first post. Is this somehow a BUG, in Rainmeter, or the ImageSize plugin?
- Win11 Pro x64 (23H2 - 22631.3085)
- Rainmeter 4.5.18
- Gigabyte B550i AORUS Pro AX V1.2
- Corsair Venegeance LPX 2x 16GB (32GB) DDR4 3200MHz
- RYZEN 7 5800X
- PowerColor RX570 8GB
- Samsung 980Pro 250GB (NVMe) - Drive C: Windows
- Kingston SNV2S1000G (NVMe) - Drive D: Rainmeter, Skins & Others - Drive D: Games
- NAS Synology DS216j - 2x 1GB HDDs - My Main Backup & Data Storage in my Home-Network
- Mon 1: 24" HP 24f (1920 x 1080 @ 75Hz) - Primary
- Mon 2: 22" Philips 226VL (1920 x 1080 @ 60Hz) - Secondary 1
- Mon 3: 50" Philips 50PUS7304/12 (3840 x 2160 @ 60Hz) - Secondary 2
- Corsair CX 650M Power Supply
- NZXT H210 Case
- ISP Vodafone with 1000/50 Mbit Cable Internet

The absolutly High-End Machine on 2024 ... at least the graphics card :oops: O.O :rofl:
User avatar
balala
Rainmeter Sage
Posts: 16623
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: ImageSize 4.0

Post by balala »

Youkai1977 wrote: February 27th, 2021, 7:09 pm No, that's not the reason either. Thanks for the idea anyway.
I still believe using the X=0 and Y=0 options, along with playing with the PreserveAspectRation option is the best and simplest solution. Don't see why should you manually calculate the vertical position of the image (meter).