Script: Thumbnail Maintenance

Discuss and share scripts and script files...
bdeshi
Posts: 4249
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Script: Thumbnail Maintenance

Post by bdeshi »

Filehero wrote:Any ideas why there are some icons "!"-marked?
You're missing some icons.
klownboy wrote:ThumbnailMaintenance_v1.13.zip
Also updated some of the messages. I did not include the icons in this update since they are available in the previous releases. Thanks,
You'll find the icons in the Thumbnail Maintenance v1.12 archive. Drop the icons at <xyscripts>.

[BTW, I've edited the script so it looks for the icons in <xyicons>\Thumbnail Maintenance :wink: ]
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Script: Thumbnail Maintenance

Post by Filehero »

:oops: :whistle:

Thanks, Sammay. Ken, all is fine. :D

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

Re: Script: Thumbnail Maintenance

Post by klownboy »

Hi, I've been s l o w l y working on an update to ThumbnailMaintenance [v1.15] since the day I posted v1.14. It's done, but needs a bit more testing. It will now recognize paperfolders in the thumbnail database and permit their deletion or rebuilding. It takes advantage of Don's undocumented (other than beta notes) SC unthumb, changes to SC exists to recognize paperfolders, and the relatively new SC property #Empty along with a number of other improvements. Hopefully I'll post early next week. Thanks Filehero and Sammay and Don - I'm making use of your new SC changes.

Edit: It figures I forgot to mention the most important change in v1.15 is to account for flexible tiles sizes and to recognize that tile size(s) may (or may not) be the same as a thumbnail size(s).
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

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

Re: Script: Thumbnail Maintenance

Post by klownboy »

Hi, I'm posting version 1.15 of ThumbnailMaintenance script. The update includes:
1) The script now recognizes Don's changes which permit flexible user defined tile sizes and that they may or may not be the same as the thumbnail sizes. You can save yourself some cache(s) and therefore diskspace (if you care) if you have tile sizes the same as thumbnail sizes since they'll share the same cache.
2) It will now recognize paperfolders in the thumbnail database (i.e., the DB options). In the "current folder" type options, the script will recognize if you are currently in a paperfolder viewing images and permit their deletion or rebuilding as it does in the DB options.
3) It takes advantage of Don's undocumented (other than beta notes) SC unthumb, changes to SC exists to recognize paperfolders, and the relatively new SC property #Empty along with a number of other improvements. Hopefully some of these will help in the speed department.
4) I left the option in the script which will zip through the entire database and check if you have any stray dat2 files or dbits files. That issue with XYplorer should not be happening anymore since Don plugged the holes which caused that to happen especially when a user turns thumbnail caching on and off... though it doesn't hurt to check. The option will also allow you to sync your XY backup of the thumbnail folder to the XY thumbnail folder. The backup can grow bigger than it should be since it can leave behind "old" cache files.

Once again please let me know if you have any issues.
Thanks,
Ken
ThumbnailMaintenance_v1.15.zip
(322.2 KiB) Downloaded 177 times
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

Stef123

Re: Script: Thumbnail Maintenance

Post by Stef123 »

Thanks Ken,
On first trial runs, I do notice an increase in speed. XY itself has also improved in that respect, it seems, and it no longer chokes on long lists which can now be scrolled w/o waiting for XY to catch up.
klownboy wrote:I left the option in the script which will zip through the entire database and check if you have any stray dat2 files or dbits files.
Glad to hear that. I have quite a few leftovers I need to clean up. Got under pressure during the busy Xmas season and - Murphy's Law- that's when the stray dat-files turned up, when I duplicated thumb-databases to protect them from contamination, when I made mistakes and messed it all up.

Will tackle it again in a more relaxed manner, or at least use it on my private machines, where I have more time and more leeway for mistakes.

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

Re: Script: Thumbnail Maintenance

Post by klownboy »

Thanks Stef123, I hope you continue to get some use out of it.
Ken
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

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

Re: Script: Thumbnail Maintenance

Post by Enternal »

So far it seems to work much better than the old script. Love the fact that it can now detect that paper folder exists natively instead of the method before. So far so good! Thanks!

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

Re: Script: Thumbnail Maintenance

Post by klownboy »

Thanks Enternal, I really didn't have any actual detection of paperfolders until v1.15. For your info, other than the database [DB] type menu options, paperfolders will only work with the ""Build Thumbnail Cache [current folder only]" menu item. The other options, like "Build Thumbnail Cache [Current Folder and Subs]" will take you to the "Build Thumbnail Cache [current folder only] menu item when the script detects your in a paperfolder.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

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

Re: Script: Thumbnail Maintenance

Post by bdeshi »

hey, another feature request: when building thumbnail cache for a folder [& subs], perhaps current viewmode (if it's thumbnail-enabled) could be pre-checked in the "Select Thumbnail Sizes" dialog.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Script: Thumbnail Maintenance

Post by klownboy »

Hi Sammay, that sounds logical. Would you be alright if it uses that same thumbnail/tile size in the current folder throughout all its sub folders (if any)? I really don't want to stop and ask a user at each sub-folder. It would be way too cumbersome. I would think that most people would want that since they may be building thumbs for the first time in the thumb view mode they currently have displayed and they would probably want he same thumb sizes for the sub folders.

In re-checking that Rebuild option for current folder and subs, I see the dialog already states what the current view is so, I'm getting that information already. That script option also flags any existing thumbnail sizes which exist in the database with a big fat dot. So I have to figure out if I can manage to have the current view (if it's a thumbnail/tile view) pre-checked along with maintaining the dot(s) to note the thumb sizes currently in the DB.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

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

Re: Script: Thumbnail Maintenance

Post by bdeshi »

klownboy wrote:Hi Sammay, that sounds logical. Would you be alright if it uses that same thumbnail/tile size in the current folder throughout all its sub folders (if any)?
Yes.
klownboy wrote:I would think that most people would want that since they may be building thumbs for the first time in the thumb view mode they currently have displayed and they would probably want he same thumb sizes for the sub folders.
..That's the point! :D
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]

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

Re: Script: Thumbnail Maintenance

Post by Filehero »

Now is the right time: Ken, this is a very helpful script and done very well!

In brief: it's great :D :appl:

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

Re: Script: Thumbnail Maintenance

Post by klownboy »

Sammay I wanted to make sure we were on the same page or should I say, on the same thumbnail. Thanks. Hopefully I can start working on a revision this weekend.

Thanks Filehero, it's always nice to get some feedback especially positive. I hope you get some use out of it.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

Stef123

Re: Script: Thumbnail Maintenance

Post by Stef123 »

Had a bunch of errors popping up. However, upon running the same situations at home to reproduce and give you more specifics, everything works fine. I'll post the error msg anyway, maybe you have use for it:
error.png
error.png (15.49 KiB) Viewed 3246 times
It came up when running Refresh Existing [current + subs]. Probably due to broken caches that got messed up before Xmas when the confusion with XY's realtime caching was in the air. Completely rebuilding those caches will hopefully fix it, but I'll have to do it one at a time, over the course of the next weeks.

Delete and Rebuild current and subs - multi-selecting from the sizes-dialog were nice-to-have. No big deal to trigger it several times in a row .... but each time the other sizes are lost again. Makes for a nice pastime, perpetual fun that never ends. :P

Empty entire cache leads to an error msg in some cases (.dbit file still in use) - it might help other users to let them know more, what they can do about it.

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

Re: Script: Thumbnail Maintenance

Post by klownboy »

Hi Stef123, thanks for the comments. I've seen that very same error message concerning the command ID #$thumb_cid is invalid and I think we've talked about it once before. Unfortunately, it seems so inconsistent. It may have something to do with the current view (i.e., when the current view is not one of the thumb/tile views in the replacelist line, it throws an error for the resultant $thumb_cid. The whole idea there was to eliminate going into a thumb\tile view if you were already in that view thereby eliminating an unnecessary rebuild...because if not it would happen twice. I've already made a change that will improve that situation for the next version 1.16, but I will revisit it again. I may be able to trap it in a better way.

Concerning the Delete and Rebuild menu item, the whole idea on the at one was to strip out all the other caches other than the "one" you really want to keep. So right now anyway I'm thinking I'd rather keep it that way and if you need to rebuild multiple size use the other options.

While working on this next version, I ran across the in use message also one time when trying to delete the strays. I think XY is still doing something there that is holding some strays from being deleted. (i.e., still in memory). I remember discussing this with Don on another thread. I think sometimes it's probably better to do an exit and restart before using that option. I've never had a problem on a restart of XY. Maybe I should build a restart into that menu option though it would have to prompt the user.

Hopefully within the next week I'll issue version 1.16. It will incorporate a change that Sammay requested where the current view will be pre-checked on some options. Such that if you want to rebuild the current folder and subs in the current view, it will obtain the view and have it pre-checked in the inputselect dialog box. That wasn't difficult, but another thing I changed was. Now "all" the thumb or tile sizes which exist in the database will be flagged (with the big fat dot - BEL) not just one when there are multiples in one size. So for example if you have a small tile size of 128 and your small thumbsize is also 128x128 and then of course your "Detail with thumbnail #1" will also be 128, all three will be flagged.
Thanks,
Ken
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

Post Reply