ThumbnailViewerGallery

Discuss and share scripts and script files...
ksarnelli
Posts: 154
Joined: 13 Dec 2014 04:48

Re: ThumbnailViewerGallery

Post by ksarnelli »

klownboy wrote:Hi ksarnelli, with Don's beta v16.20.0005 paperfolders are working great from command line. He said if he didn't get the /flat on that beta the next beta will. It does appear to be working in 16.20.0005.
Confirmed - the /flat option works on the latest beta and no longer need to use the goto method, awesome! :mrgreen:

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: ThumbnailViewerGallery

Post by klownboy »

Yes, it works really nice now no shuddering. Toggling the Gallery Mode on and off could or would be a nice native feature for XY. With a few changes, Don could probably do that much slicker than we are using a separate instance. If we could change a few options quickly on the fly it could be done in the same or existing instance of XY like changing the Padding, Zoom to Fill, Captions, and most importantly be able to quickly change the thumbnail cache folder on the fly via scripting. :tup: I already asked about the caption and he was open to it (later).

admin
Site Admin
Posts: 64847
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ThumbnailViewerGallery

Post by admin »

I might add it to 16.30. :)

admin
Site Admin
Posts: 64847
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ThumbnailViewerGallery

Post by admin »

Next version has an explicit /path switch for the command line. It overwrites any non-switch path.

E.g., this will start at PF "caipu23", and ignore C:\:

Code: Select all

XYplorer.exe /path=paper:caipu23 C:\"
I guess the /path switch allows for easier readable and constructible command lines.

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: ThumbnailViewerGallery

Post by klownboy »

Very cool! Just curious, how would you do it natively - by allowing the user to set up an alternate thumbnail database folder for the Gallery type thumbnails and then have the settings toggle for Zoom to Fill, Caption, Style and Padding? That's pretty much was done with the script, but of course you have to use a 2nd instance of XYplorer to establish those settings and alternate database. Or, possibly a different set of thumbnail settings or criteria that is user definable? I'm actually a bit surprised how fast XY is at bringing up an alternate thumbnail view in a 2nd instance of XY especially considering it's thumbnails were talking about of course that's after the initial thumbnail build.

OK, I just noticed your post, so the "/path=" switch will probably deprecate Start Path following the "/ini=" switch. Why would a user have, as you wrote above 2 paths specified - the C:\ following the paper path? Is it for the other pane? I'm not sure what you mean about "constructible command lines". I quess you mean anything that was there as a separate folder will be ignored and only the folder path followng the /path= switch will be used.

admin
Site Admin
Posts: 64847
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ThumbnailViewerGallery

Post by admin »

1) I still need to think up the details... :)

2) That example was just to demonstrate the overruling. Nobody would actually use such a command line. All previous syntax still works, nothing breaks, it's just an additional option. I just found it strange that there is one parameter without a switch, and such an important one. Maybe I'm a symmetry freak...

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: ThumbnailViewerGallery

Post by klownboy »

Yes, that was a little odd that the "Start path" folder was specified after the switch /ini=XY_Different.ini without it's own switch. As I mentioned earlier, the startup folder seemed to be working no matter where it was located anyway. I think this will clarify that situation.

ksarnelli
Posts: 154
Joined: 13 Dec 2014 04:48

Re: ThumbnailViewerGallery

Post by ksarnelli »

admin wrote:1) I still need to think up the details... :)

2) That example was just to demonstrate the overruling. Nobody would actually use such a command line. All previous syntax still works, nothing breaks, it's just an additional option. I just found it strange that there is one parameter without a switch, and such an important one. Maybe I'm a symmetry freak...
Agreed about the switch, seems for structured with the /path=.

As for a native gallery mode, I still think it makes the most sense as just a separate view mode (basically a very specific extension of the thumbnail view mode with some static settings). The tricky party would be the caching, since the user may not have zoom-to-fill enabled on their regular thumbnail view. Creating 2 thumbnails in the cache for every file (zoom to fill enabled and disabled) might be a good solution, and as a bonus it would also allow people to change that setting in normal thumbnail view mode on the fly without having to regenerate thumbnails.

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: ThumbnailViewerGallery

Post by klownboy »

ksarnelli wrote:...The tricky party would be the caching, since the user may not have zoom-to-fill enabled on their regular thumbnail view. Creating 2 thumbnails in the cache for every file (zoom to fill enabled and disabled) might be a good solution, and as a bonus it would also allow people to change that setting in normal thumbnail view mode on the fly without having to regenerate thumbnails.
The thumbnail caches for each folder are very structured to the folder filename and its specific thumbnail size, both the .dat2 and the corresponding .dbits file where the actual thumbnail is located. As is, the same folder with a different thumbnail size has to have a different pair of cache files (dat2 and dbits) since the cache filename itself is based on the hash of the folder and thumbnail size.

So unless the entire thumbnailing process was rewritten, I think Don would elect, at least for now anyway, to simply have an additional, say alternate or secondary cache location where the user could specify an alternate set of thumbnailing specifications or it could be more rigid and be the Zoom to Fill cache location and the "normal" cache could be the non Zoom to Fill thumbnails. Gallery Mode could act as a toggle. You'd want to be able to trigger it on and off on the fly with a Customized User Button / CID. XY would use the alternate cache location when the user selects Gallery mode, and use the normal cache when it's off. Users with Zoom to fill as the their normal setting would probably have to regenerate some thumbnails, but that's not a big deal (I had to do it to get Zoom to Fill thumbs for our script. We'll have to wait and see what Don has in mind, but it sounds promising.

Don just so you know, the alternate location with a different XY_ different.ini file as used the script works fine as far as generating the new thumbs and updating XYthumbs.txt file in the alternate folder. Thinking out load again sorry, but maybe the simplest approach would be to have a "Zoom to Fill" cache location and a Normal or non Zoom to Fill cache location. All the other specifications required for Gallery Mode are all independent and don't require a change like Padding, Style, or Captions (i.e., it's only the Zoom to Fill Option that requires a different cache, other than folder and thumb size). This way if a user has Zoom to Fill mode 'on' the thumbs are in one folder and if not, they're in another and depending on whether he has the gallery mode toggle on or off determines where XY goes to use a cache or generate a cache on first run.

ksarnelli
Posts: 154
Joined: 13 Dec 2014 04:48

Re: ThumbnailViewerGallery

Post by ksarnelli »

klownboy wrote:Thinking out load again sorry, but maybe the simplest approach would be to have a "Zoom to Fill" cache location and a Normal or non Zoom to Fill cache location.

That's actually what I was trying to say :) Just that I was suggesting generating both thumbnails for all files regardless of the current view mode/setting, but I guess that is not necessary.

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: ThumbnailViewerGallery

Post by klownboy »

Hi ksarnelli, yes I suppose in the end, we're close on are thinking. It was your statement of creating 2 thumbnails in the cache for every image (normal and zoomed) that through me off. The existing naming scheme for the thumbnail cache files, since it's based solely on folder name and thumb size, wouldn't accommodate thumbs of both types for each file in the cache or even in the same cache folder. That would be one reason why Zoom to Fill is currently across the board. An example of what's contained in the cache .dat2 file is: "G:\Wallpaper\Jamaica*240x180" and that cache's filename is based on the hash of that in quotes. So Don would have to modify that to have some designator of Normal or Zoom like for example: "G:\Wallpaper\Jamaica*240x180*0" to designate normal thumb cache and "G:\Wallpaper\1920x108*240x180*1" for zoom. That's quite a bit of work. Edit: Another possibility would be to maintain the same hash naming scheme, but affix a designator to the hash base name to identify it as Normal or Fill to Zoom. Don's thumbnail cache in its present form has been around for quite some time. He probably couldn't automatically put both types in the same cache file either without a great deal of work and he still would need some way to retreive the right type within the file...sounds too complicated...and of course it would slow down thumbnail generation. That's one big thing I like about XY is the speed of thumbnail viewing at least once they're generated. :)

totmad1
Posts: 131
Joined: 24 Jun 2013 12:37

Re: ThumbnailViewerGallery

Post by totmad1 »

Hi Ken
had a wild idea to try from another direction and came up with this .

Code: Select all

"Thumbnail Gallery"
	#182;
  //zip_add("<xydata>\xyplorerini.zip", "<xydata>\xyplorer.ini");
	$layout=getkey("TitlebarTemplate", "General");
	$match=regexmatches($layout, "(MAIN_Layout)");
	if ($match==(MAIN_Layout)) {
  // zip_add("<xydata>\xyploreriniMAIN.zip", "<xydata>\xyplorer.ini");
	setkey "<path> - <app> <ver>   (Gallery_Layout)", "TitlebarTemplate", "General";
	setkey 300, "Width2", "Thumbs";
	setkey 300, "Height2", "Thumbs";
	setkey 0, "Padding", "Thumbs";
	setkey 0, "Style", "Thumbs";
	setkey 0, "ShowCaptions", "Thumbs";
	setkey "Thumbnails\Gallery\", "CacheDir", "Thumbs";
	setkey 1, "ThumbsZoomToFill", "Thumbs";
	}
	else {
  // zip_add("<xydata>\xyploreriniGallery.zip", "<xydata>\xyplorer.ini");
	setkey "<path> - <app> <ver>   (MAIN_Layout)", "TitlebarTemplate", "General";
	setkey 256, "Width2", "Thumbs";
	setkey 256, "Height2", "Thumbs";
	setkey 5, "Padding", "Thumbs";
	setkey 4, "Style", "Thumbs";
	setkey 1, "ShowCaptions", "Thumbs";
	setkey "Thumbnails\", "CacheDir", "Thumbs";
	setkey 0, "ThumbsZoomToFill", "Thumbs";
	}
	#190;
the three commented out "zip_add" lines were put in as alternatives.
it does lead to other ideas.
totmad1 (totally mad one)

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: ThumbnailViewerGallery

Post by klownboy »

Hi totmad1, that's a nice alternative method. I hadn't caught all the modifications I needed to make it similar to my settings and it messed up my ini file a little, but hey that's what backups are for. Once I made the necessary setting changes and thumbnail sizes for my system it worked fine. I also had to remove my specified startup path so that it would cycle in the same folder I was in previously (i.e., instead of opening in C:\). Actually though, I don't think it's any faster than simply starting the new instance using another ini file as I did. By the way, did you notice it changing the instance when you restart with a different template. It was instance "2", I'm not sure if that's due to the title template changing or what. Check using, echo get("instance"); Don said above he will incorporate a Gallery Mode or similar which will be great.

admin
Site Admin
Posts: 64847
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: ThumbnailViewerGallery

Post by admin »

Next version will add some improvements to the caching of "Zoom to Fill" thumbs. A good step towards Gallery mode... however, I think finally "Zoom to Fill" should probably be per-tab (now it's global). This is too much work for now though.

klownboy
Posts: 4397
Joined: 28 Feb 2012 19:27
Location: Windows 11, 25H2 Build 26200.7171 at 100% 2560x1440

Re: ThumbnailViewerGallery

Post by klownboy »

In the end implementation of "Gallery Mode" would permit the user to swap from a normal thumbnail mode with captions, padding, and border to a Gallery Mode via a CKS or CTB. I'm not sure you'd want to try to get the "Zoom to Fill" style type thumbs melded into the same "Thumbnails" folder or not since the cache files are both currently based on the same criteria (folder and thumbnail size) and it's across the board as you said. Unless you came with a way to distinguish a "Zoom to Fill" style thumbnail cache from a normal thumbnail cache file. Yes, you could have it tied to a Tab settings or a FVS, but you would have to distinguish the different style cache files when they are in the same folder.

Maybe it would be easier to implement to have a separate set of settings associated with "Zoom to Fill". It would be similar to what we do above using a different ini file in a 2nd instance. You could change from Normal thumbs settings in [Thumbs] to another set which would be Zoom to Fill or gallery settings [ThumbsZoom2Fill] including a different thumbnails cache folder. Going into "Gallery Mode" would implement settings like below and reverting back to Normal would use the normal [Thumbs] section of the ini. It would be like having a second implementation of thumbnails not necessarily tied to looking like a Gallery Mode but certainly that would be the best implementation.

Code: Select all

[ThumbsZoom2Fill]
CacheDir=D:\Tools\XYplorer\GalleryThumbs\
Width2=240
Height2=240
ShowCaptions=0
ThumbsZoomToFill=1
SymbolCaptionLines=1
Padding=0
Style=0
Cache=1
Just a thought...when the time comes. Thanks.

Post Reply