It is currently January 29th, 2023, 8:16 pm

FileChoose [Ver.1.2.0.1]

Share and get help with Plugins and Addons
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: FileChoose [Ver.1.2.0.1]

Post by death.crafter »

Jaime Méndez wrote: September 1st, 2022, 5:07 am Hello, I hope someone can help me. I am trying to get a thumbnail from a photo file instead of its icon, but i couldn't get FileChoose PlugIn to work at all. The original code of "EXpandable" skin uses FileView PlugIn:
It's not very clear what you want to do here. Can you link the skin you're trying to modify? And explain what modifications you want to bring.
from the Realm of Death
User avatar
Jaime Méndez
Posts: 95
Joined: August 31st, 2022, 10:00 pm

Re: FileChoose [Ver.1.2.0.1]

Post by Jaime Méndez »

death.crafter wrote: September 1st, 2022, 2:00 pm It's not very clear what you want to do here. Can you link the skin you're trying to modify? And explain what modifications you want to bring.
Hi, It is an interesting skin code that expands folders in a very intuitive mode. Unfortunately it won't show thumbnails when folder files are photos or videos, it just shows the icon assigned to its type of file. The code uses FileView plugIn.
I would like to translate it so it can run with FileChoose plugin instead so it can show photo files thumbnails and not just its icon whenever I mouseover.

You ca find a demo of the skin here: https://youtu.be/WEQzOHPr5ho
And the skin here: https://github.com/juh9870/EXpandableFolder/releases/tag/1.0.0

Thank you for trying to help!
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: FileChoose [Ver.1.2.0.1]

Post by death.crafter »

Jaime Méndez wrote: September 1st, 2022, 3:23 pm Hi, It is an interesting skin code that expands folders in a very intuitive mode. Unfortunately it won't show thumbnails when folder files are photos or videos, it just shows the icon assigned to its type of file. The code uses FileView plugIn.
I would like to translate it so it can run with FileChoose plugin instead so it can show photo files thumbnails and not just its icon whenever I mouseover.

You ca find a demo of the skin here: https://youtu.be/WEQzOHPr5ho
And the skin here: https://github.com/juh9870/EXpandableFolder/releases/tag/1.0.0

Thank you for trying to help!
Ohh I see. But filechoose plugin isn't the right choice here tbh. What you can do is check for file extensions, and use the file itself as image if the extension is jpg, png or some other supported image format
from the Realm of Death
User avatar
Jaime Méndez
Posts: 95
Joined: August 31st, 2022, 10:00 pm

Re: FileChoose [Ver.1.2.0.1]

Post by Jaime Méndez »

death.crafter wrote: September 1st, 2022, 3:42 pm Ohh I see. But filechoose plugin isn't the right choice here tbh. What you can do is check for file extensions, and use the file itself as image if the extension is jpg, png or some other supported image format
How could In do it?
Could you give an example how to get an image from a image format file?

The example code that comes with the downloaded FileChoose plugin works great. It shows a thumbnail and read.txt says you can get the icon with any other method than a specific user action like "LeftMouseUpAction" in order to get the file info

"ChooseFile N", "ChooseFolder N", "ChooseImage N"
N is a number. When finished choosing, the option CommandN will be executed.
Examples:
LeftMouseUpAction=[!CommandMeasure MeasureChoose "ChooseFile 1"]

"Resolve N PATH"
N is a number. When finished choosing, the option CommandN will be executed.
PATH is a string of a file's path. Must not contain "".
This bang enable users to send a filepath to the plugin, then reslove the path
as if the path is chosen by "ChooseFile". This means you can get a path with
another method and just use the plugin to resolve it, and get the information.
You do not have the required permissions to view the files attached to this post.
Last edited by Jaime Méndez on September 1st, 2022, 4:02 pm, edited 1 time in total.
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: FileChoose [Ver.1.2.0.1]

Post by death.crafter »

Jaime Méndez wrote: September 1st, 2022, 3:47 pm How could In do it?
Could you give an example how to get an image from a image format file?
I am not really at my PC rn, so it's hard for me to cook an example right away. If you could give me more time, I can make one for you tonight.
from the Realm of Death
User avatar
Jaime Méndez
Posts: 95
Joined: August 31st, 2022, 10:00 pm

Re: FileChoose [Ver.1.2.0.1]

Post by Jaime Méndez »

death.crafter wrote: September 1st, 2022, 3:48 pm I am not really at my PC rn, so it's hard for me to cook an example right away. If you could give me more time, I can make one for you tonight.
oh! I just edited my past reply, thank you! I definitely wait any time you need for your help.

Thank you
User avatar
Yincognito
Rainmeter Sage
Posts: 4838
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: FileChoose [Ver.1.2.0.1]

Post by Yincognito »

Jaime Méndez wrote: September 1st, 2022, 5:07 am Hello, I hope someone can help me. I am trying to get a thumbnail from a photo file instead of its icon, but i couldn't get FileChoose PlugIn to work at all. The original code of "EXpandable" skin uses FileView PlugIn. [...]
Here's what you need to do. Open your [SkinFolder]\@Resources\include\tiles.inc.template file in your favorite text editor and:

1) comment the OnChangeAction line in the [MeasureFileIcon%%] measure by adding a ; at the start of the line:

Code: Select all

; OnChangeAction=[!SetOption MeterTileIcon%% ImageName [MeasureFileIcon%%]]
2) add the following after the [MeasureFilePath%%] measure, to get the file type and change the corresponding meter's image name based on whether the type is of an image or not (the full path to the file including the file name and extension if it's an image, or the FileView's created icon files that correspond to the system's icon for that file type):

Code: Select all

[MeasureFileType%%]
Measure=Plugin
Plugin=FileView
Path=[MeasureFolder]
Index={%%+1}
Type=FileType
IfMatch=(?i)^(?:png|jpg|bmp|gif|tif|webP|ico)$
IfMatchAction=[!SetOption MeterTileIcon%% ImageName "[MeasureFilePath%%]"]
IfNotMatchAction=[!SetOption MeterTileIcon%% ImageName "[MeasureFileIcon%%]"]
IfMatchMode=1
3) add the following line to the [MeterTileIcon%%] meter, to avoid distorting the thumbnail to match the square shape used by the tiles and display it using its original aspect ratio between the image's width and height:

Code: Select all

PreserveAspectRatio=1
That's it - if the file is an image, a thumbnail will be displayed; if not, the system's file icon will. Save the file, refresh the skin, and admire your thumbnails:
FileView Thumbnails.jpg
You do not have the required permissions to view the files attached to this post.
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: FileChoose [Ver.1.2.0.1]

Post by death.crafter »

Well, Yinco just did what I had in mind. Thanks Yincognito, for saving me the trouble :rosegift:
from the Realm of Death
User avatar
death.crafter
Rainmeter Sage
Posts: 1398
Joined: April 24th, 2021, 8:13 pm

Re: FileChoose [Ver.1.2.0.1]

Post by death.crafter »

That aside, the performance won't be great, because you'd be rendering the very large in size images themselves and not their thumbnails.
from the Realm of Death
User avatar
Yincognito
Rainmeter Sage
Posts: 4838
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: FileChoose [Ver.1.2.0.1]

Post by Yincognito »

death.crafter wrote: September 1st, 2022, 5:26 pm Well, Yinco just did what I had in mind. Thanks Yincognito, for saving me the trouble :rosegift:
No problem, crafter of all which is script under the Sun - I thought you might appreciate enjoying a beer tonight instead of writing code. 8-)
Hopefully it will be what the OP had in mind as well. :???:
death.crafter wrote: September 1st, 2022, 5:29 pm That aside, the performance won't be great, because you'd be rendering the very large in size images themselves and not their thumbnails.
Yep, noticed that. There would be a proportional delay in displaying several big images in the skin, indeed. :(
This is unfortunately, unavoidable - Rainmeter needs time to read and scale those images from the drive. :confused: