Script: Thumbnail Maintenance

Discuss and share scripts and script files...
Stef123

Re: Script: Thumbnail Maintenance

Post by Stef123 »

Filehero wrote:.... only generate thumbs if XY's option Show Cached Thumbnails Only is unticked.
...
Is it only me?
I remember hitting upon similar issues. Back then I was too busy to post in the forum, couldn't comment on the new cached-only feature when it got implemented by Don. Even though it was my own wish, I wanted it desperately, so I simply worked around the issue by adding some lines to my CTB-triggers. My CTB-menu calls up subscripts directly from Ken's meaintenance script, so basically, I sandwiched the sub-calls between SendKeys statements that switch config-settings.
klownboy wrote:I'll add a detection for "Show Only Cached Thumbnails" setting being ON, (if (getkey("CacheReadOnly", "Thumbs") == "1") { and provide a message that states to turn it off if you plan on rebuilding or refreshing thumbnails caches.
:tup:

klownboy
Posts: 4090
Joined: 28 Feb 2012 19:27

Re: Script: Thumbnail Maintenance

Post by klownboy »

There is no CID for "Show only cached thumbnails", but I wonder if Don could add one. If it could take affect on the fly without restart, it would be very helpful in any scripts involving thumbnails. Do you think it's worth asking? I could turn it off up-front for the user - after asking (instead of just providing a message), but that currently would involve a restart for it to take affect.
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Stef123

Re: Script: Thumbnail Maintenance

Post by Stef123 »

klownboy wrote: I could turn it off up-front for the user - after asking (instead of just providing a message), but that currently would involve a restart for it to take affect.
Yes, I think it's worth it. Although I cope with it thanks to my workarounds, I still think many others would benefit from such a change, especially the not so heavy users who may be less familiar with the various modes of operation.

klownboy
Posts: 4090
Joined: 28 Feb 2012 19:27

Re: Script: Thumbnail Maintenance

Post by klownboy »

Hey Stef123, I think it would be worth it too. I went ahead and put it in Wishes. I was able to do it via sendkeys and CID #310 and it would not require a restart (in-case Don doesn't come up with a new CID for "Show only cached thumbnails"). With this method or a new CID, I think I should be able to do it without getting user intervention or messages since I'd be turning off "Show only Cached thumbnails" in the beginning and turning back on before the script terminates. Of course this would only apply if the user had it ON in the first place. :)
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Script: Thumbnail Maintenance

Post by Filehero »

Hi Ken,

your proposed solution to "just" add a conflicting setting checker is simply elegant - perfectly fine and sufficient for me. :D :tup:

We may ask Don wether he's willing to add "Show only cached thumbnails" to the settings supported by SC Setting?
klownboy wrote: So based on the above I'll add a detection for "Show Only Cached Thumbnails" setting being ON, (if (getkey("CacheReadOnly", "Thumbs") == "1") { and provide a message that states to turn it off if you plan on rebuilding or refreshing thumbnails caches.
Cheers,
Filehero

klownboy
Posts: 4090
Joined: 28 Feb 2012 19:27

Re: Script: Thumbnail Maintenance

Post by klownboy »

Hi Filehero, you're back. Did you have a good time?

I asked Don if he could give us a CID for Show Cached Thumbnails Only which would allow me to turn it off on the fly. Give me a thumbs up or +1 there if you get a chance and it will bump it up. :) A SC settings change would also work, but a CID might be more helpful all around in scripting. So in any case, I wouldn't have to really ask or have a message at all (I hate to have those if it's not necessary - just one more thing to click through) as I mentioned above. The script would detect if it was set ON and turn it OFF and turn it back ON when the script exits. I managed to do it via sendkeys but that results in a minor flicker, but it does take affect immediately when done that way verses modifying the ini file which requires a save.
Thanks.
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Script: Thumbnail Maintenance

Post by Filehero »

Hi Ken,
klownboy wrote:I asked Don if he could give us a CID for Show Cached Thumbnails Only which would allow me to turn it off on the fly. Give me a thumbs up or +1 there if you get a chance and it will bump it up. :)
Done. :)
klownboy wrote:Did you have a good time?
Except the f*****g (sorry for that) weather, yes. :mrgreen:

Unfortunately, sun had left us alone and we hadn't any sight on every summit we had been (and they were quite a few - without the Watzmann we'd skipped for the very same reasons quite early in the first place)*. Nevertheless, it was a very good time, because the landscape is absolutely great and the locals are wonderful people.
And of course, we went to the Führer's nice-guy-from-the-mountains-exhibition one of those rainy days. Sarcasm apart, it's worth the visit but really deserves time to spent.

FH

*: One of those days I decided to reward me with a new supa-dupa camera: it will be either a Sony A7II(r) with Zeiss' Loxias 35 & 50 or the upcoming Pentax FF. :P
Last edited by Filehero on 12 Sep 2015 03:20, edited 1 time in total.

klownboy
Posts: 4090
Joined: 28 Feb 2012 19:27

Re: Script: Thumbnail Maintenance

Post by klownboy »

Hi again, Filehero, you can never depend on the weather, can you, especially planning months in advance. I'm sure you had a nice time despite the weather!

I've been looking at buying my first DSLR maybe before the holidays. I read a bit on the Sony A7SII - looks nice but on the pricey side.
http://www.bhphotovideo.com/c/product/1 ... gital.html
http://www.bhphotovideo.com/explora/pho ... -Video#vid
I've been looking at the Nikon D750 as well not quite so expensive - extremely good reviews as well. Full frame and actually on the small side for a full frame DSLR. http://www.dpreview.com/reviews/nikon-d750/16 I have no investment in lenses so I'm starting fresh.

Thanks for the bump (and Stef123 as well). :)
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Papoulka
Posts: 455
Joined: 13 Jul 2013 23:41

Re: Script: Thumbnail Maintenance

Post by Papoulka »

Just trying this out of interest...

Is v1.16 the latest? I've gotten confused between the two threads that discuss it.

Nothing to do with the script, but icon "refresh_04.ico" alone shows strange numbers when I enable "Dimensions" as a custom column. Where the others show 256 x 256, 128 x 128, and 32 x 32, this one shows 2098176 x 48. Do you see the same thing?

Thanks

klownboy
Posts: 4090
Joined: 28 Feb 2012 19:27

Re: Script: Thumbnail Maintenance

Post by klownboy »

Hi Papoulka, this should be the main thread. Any others may be bringing up wishes or asking questions. Version 1.16 is the latest, but I'm working on v1.17, but for the most part the only significant change will be recognizing if a user has "Show Cached thumbnails Only" set ON and it will temporarily turn it off to accomplish maintenance. Rebuilding thumbnail caches doesn't work well with that setting on. In the meantime if you have it ON, I'd set it OFF before using the script to rebuild or refresh thumbnails. Deleting caches shouldn't be a problem.

Yes, I see what you mean on the dimension of refresh_04.ico. Though looking at he various sizes in Preview, they look fine. You can substitute if you want. I simply grabbed those from some free icon sites. I'm sure they're alright.
Thanks,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

klownboy
Posts: 4090
Joined: 28 Feb 2012 19:27

Re: Script: Thumbnail Maintenance

Post by klownboy »

Hi, posting ThumbnailMaintenance v1.17...
As Filehero mentioned a few post back, when "Show Cached Thumbnails Only" is ON, this script does not function as it should. The script uses "Refresh Thumbnails" (CID #501) many times in the various script options to rebuild or refresh folder thumbnails and it fails miserably to perform a complete rebuild if that setting is checked ON. So this script will temporarily turn the setting off using the newly added SC setting "cachethumbsreadonly". It will first check the setting in XYplorer.ini file such that at the end of the script the setting will be returned will to ON if the user originally had it ON. Though it will turn the setting off regardless of the current setting incase someone just recently turned it ON but had not saved the setting.

Also in some menu items where you select the thumbnail size(s) to rebuild, the first thumbnail size (e.g., Current thumbnail size(s)) was made the default pre-selected option.

I also saved this file in UTF-8 (with BOM) instead of ANSI since Windows 10 seems to wreck havok on any special characters displaying properly in XYplorer.

Thanks and again please let me know if you experience any problems.
Ken
ThumbnailMaintenance_v1.17.zip
(322.89 KiB) Downloaded 363 times
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Filehero
Posts: 2644
Joined: 27 Feb 2012 18:50
Location: Windows 10 Pro x64

Re: Script: Thumbnail Maintenance

Post by Filehero »

Hi Ken,

I've just been running a Foreground Delete & Rebuild on a nested folder structure. The "Show Cached Thumbnails Only" flag was still there after the end, and every preview image has been restored successfully.

One word: superb!! :appl: :appl:

Thank you very much. :D :D

Cheers,
Filehero
klownboy wrote:
ThumbnailMaintenance_v1.17.zip

bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Script: Thumbnail Maintenance

Post by bdeshi »

Image super script!
this should be included with XYplorer install packages.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

klownboy
Posts: 4090
Joined: 28 Feb 2012 19:27

Re: Script: Thumbnail Maintenance

Post by klownboy »

Thanks Filehero and Sammay for the kind comments. They make working on scripts more rewarding. :)
Cheers,
Ken
Windows 11, 22H2 Build 22621.1555 at 100% 2560x1440

Enternal
Posts: 1174
Joined: 10 Jan 2012 18:26

Re: Script: Thumbnail Maintenance

Post by Enternal »

Thanks for the new version of the script! It works really well! Definitely one of the scripts that I always have in the toolbox especially when working on so many images. :biggrin:

Post Reply