Purging thumbnails...?

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Purging thumbnails...?

Post by Marco »

Looks like, with Tiles views, that the visual road is quite defined.
I was wondering if there's some purging command/functionality for older thumbs in XY dbits files pointing to files that no longer exist.
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

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

Re: Purging thumbnails...?

Post by admin »

Long planned but never done.

But you can do it manually quite easily by looking into the files in the thumbs cache folder and checking the file dates (if they look old). And then simply delete them.

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Purging thumbnails...?

Post by Marco »

Mmh ok...
And another curiosity: how are the names of the thumbs databases generated? Looks like an hash, but of what?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

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

Re: Purging thumbnails...?

Post by admin »

Marco wrote:Mmh ok...
And another curiosity: how are the names of the thumbs databases generated? Looks like an hash, but of what?
md5 of path and size, like this: md5("E:\TestFiles\pics\*48x48")

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

Re: Purging thumbnails...?

Post by klownboy »

Hi Marco,
Doesn't the XYthumbs.txt file, located in the thumbnail folder, list all the thumbs by drive\folder location and also provides the MD5 value? I looked at the text file and did find the corresponding thumb files in the "thumbnails" folder. Each folder location in the XYthumbs.txt file has a corresponding "MD5 value.dat2" and "MD5 value.dbits" file in the XYplorer thumbnails folder.
For example line,

Code: Select all

I:\1920x1080\Fields\|240x180|2efd5ab334aade6dfcdb1c4c24d2cf10
in my XYthumbs.txt file has a corresponding

Code: Select all

2efd5ab334aade6dfcdb1c4c24d2cf10.dat2
2efd5ab334aade6dfcdb1c4c24d2cf10.dbits
So until Don makes it a bit easier to delete old thumbs or more importantly thumbs on flash/removable drives that we simply don't want to keep (Thumbnail Cleanup), couldn't someone (someone with a bit more XY scripting knowledge than me :) ), come up with a script that would list the files in the XYthumbs.txt file and then allow you to select the folder location(s), obtain the MD5 values and select the corresponding two thumbs files, for each location, and then delete the thumbs. That sounds like it would be very handy to for clean up purposes. The text file does list the thumbnail size which would also help in determining which thumbs to delete. Unfortunately though the XYthumbs.txt file doesn't have the dates of the thumb folders so one would be selecting by folder location alone, but maybe the file dates could also be obtained to make a more informative decision before deleting.

Thanks,
Ken

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Purging thumbnails...?

Post by Marco »

That's exactly my idea. But, as Don would say... after the summer :mrgreen:
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

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

Re: Purging thumbnails...?

Post by klownboy »

Hey again Marco and Don,

Unfortunately, I'm not sure how well using the XYthumb.txt file will work since I discovered that as soon as you mess with the file in any way, it regenerates from the beginning loosing all the folder data that it previously contained (i.e., starts fresh). Not sure why it did that. I had deleted some folder entries in XYthumbs, but also deleted the corresponding dbits and dat2 files in the thumbnails folder.

I've been playing with the MD5 hash, as Don explained above how it was generated, and it does give the proper results

Code: Select all

::text hash("MD5","<curpath>\*240x180");
does provide the same hash as that in the XYthumb.txt folder for the particular folder. Is there a way to work backwards from the known MD5 hash value (thumbnail base filename) to obtain the folder and thumbsize ratio (i.e., working backwards)? I've been looking at the details for using the hash command in the help with no luck...is it not possible to un-hash so-to-speak?

Thanks,
Ken

Edit: From what I'm reading, I guess that's the whole idea with hash that it's not possible or better not be. So I wonder if there's a way to regenerate the list of folders/thumbs size ratios contained in the XYthumbs.txt file (i.e., update or get a current list of thumb folders)? Probably not since the hash is generated when you initially view the folder as thumbnails.

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

Re: Purging thumbnails...?

Post by admin »

Don't waste your time on this. One day I'll add it and from here it's so much easier to do.

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

Re: Purging thumbnails...?

Post by Enternal »

Yeah it's a hash so it supposed to be a one-way-street. But yeah I noticed that too that once you messed with the file, for some reason, it wants to rehash a lot of those files again which is rather odd. Not only that, I generally find the cache feature a bit "unstable" at times. I can't count how many times it starts re-caching a folder for no good reason.
Edit: From what I'm reading, I guess that's the whole idea with hash that it's not possible or better not be. So I wonder if there's a way to regenerate the list of folders/thumbs size ratios contained in the XYthumbs.txt file (i.e., update or get a current list of thumb folders)? Probably not since the hash is generated when you initially view the folder as thumbnails.
Can't you just open that XYthumbs folder because it really does list all those locations. It's in the format of Location|Size|Hash is it not? Or maybe I'm just confused at your question.

Don, just to verify, so each of those dbits file store ALL the thumbnails of a certain location. For example, 788827bfda753abeda3f14941f9fb119.dbits has all the thumbnails of the location C:\Users\User\Desktop and the has if of the dbits file itself right?

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

Re: Purging thumbnails...?

Post by admin »

Enternal wrote:I can't count how many times it starts re-caching a folder for no good reason.

Don, just to verify, so each of those dbits file store ALL the thumbnails of a certain location. For example, 788827bfda753abeda3f14941f9fb119.dbits has all the thumbnails of the location C:\Users\User\Desktop and the has if of the dbits file itself right?
1. Oh really? I have not seen this for years. If you find a way to repro it...

2. Uhm, yes (although I did not fully understand the question).

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

Re: Purging thumbnails...?

Post by klownboy »

Don thanks. I can wait. I was just curious if we could do something ourselves through scripting and I suppose we could provided the XYthumbs file was correct/up-to-date.

Enternal My edit line was a little confusing. What I meant to say was: Yes, if the "XYthumb.txt" file was up to date and not messed up because I played with it, we could grab the folder|thumbnail size|MD5 hash and use it in a script. But, since I did mess with XYthumbs.txt file, my question was, was there a way to re-generate the "XYthumbs.txt" properly based on the "thumbnails" folder contents. Apparently not, at least from our end, since the folder hash is generated when you view the folder as thumbnails and modified when you change the folder's contents. We would probably have to go into every folder containing thumbnails and regenerate the XYthumbs.txt file. I suppose if you did that with every thumbs folder you really wanted to keep then you could compare the hashes in XYthumbs.txt to those in the thumbnails folder and delete those that don't match up.

Thanks,
Ken

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

Re: Purging thumbnails...?

Post by admin »

Yes.

Frankly this code "just works" for years now. I would have to look into it to really answer your question. No time for that now.

nerdweed
Posts: 648
Joined: 25 Feb 2012 07:47

Re: Purging thumbnails...?

Post by nerdweed »

Scripting wouldn't be the solution for this.

A cache file would have to be compressed internally as well as files from a particular folder would be deleted, renamed, etc.

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

Re: Purging thumbnails...?

Post by klownboy »

Hi nerdweed,

I wasn't thinking of caching or re-caching folders of thumbs, I was simply considering the possibility of deleting those xxxx.dat2 files and xxxx.dbit files in the XYplorer "thumbnails" folder which refer to (1) old folders or (2) folders on flash drives or external drives, (3) folders with thumb sizes I no longer use (i.e., cleaning house of the "dat2" and "dbit" files in the thumbnails folder that I really don't care or no longer wish to have to have XY maintaining). By the way, if you open one of xxxx.dat2 files in a text editor, the folder and thumb size is present.

Thanks,
Ken

Marco
Posts: 2354
Joined: 27 Jun 2011 15:20

Re: Purging thumbnails...?

Post by Marco »

Guys, this is my setup: I have a folder (Wallpaper) set to be always viewed as thumbnails via FVS. Then I sometimes view subdirectories of the desktop as thumbnails or tiles. These last ones are entries that would "pollute", from my pov, my thumbs cache.

If I manually edit the XYThumbs.txt by removing the lines about those subfolders and I delete the corresponding dat2/dbits files, then everything works smoothly. Seems to me that a script, meanwhile, would work. What problems are you experiencing?
Tag Backup - SimpleUpdater - XYplorer Messenger - The Unofficial XYplorer Archive - Everything in XYplorer
Don sees all [cit. from viewtopic.php?p=124094#p124094]

Post Reply