Page 1 of 1

Refresh thumbs delete cache files if no image files exist

Posted: 11 Nov 2022 17:03
by klownboy
I ran across this statement the other day in Help, in View menu -> Caches (Submenu)
Refresh Thumbnails. The statement: "When a list no items with thumbnails but a pair of thumbnail cache files for it still exists (for images that are not here anymore) calling "Refresh Thumbnails" will permanently delete those thumbnail cache files".

I wasn't aware of this, so I ran some tests. It's relatively easy to check. Load a temp folder with some JPGs. Change the view to a thumbnail view. Make sure the cache files are generated. Now go ahead and delete the files. Check to see that the thumbnail files still exist. Return to the same thumbnail view (if necessary). Now run "Refresh thumbnails" from the menu. The cache files (ini and dbits) remain, and they are present even after a restart. Deleting all the images (all the files) or the entire folder does not remove the cache files.

Not a huge deal Don, I wasn't aware the statement existed. Maybe the transition to "ini" files affected this or maybe it never worked? In any case, it doesn't work now, and as mentioned, deleting entire folders does not remove the cache files.

Maybe the statement needs to be deleted, but it actually could be a good idea especially in scripting, deleting all the image files and running CID #501 to clean out the cache files - if it worked. Thanks.

Re: Refresh thumbs delete cache files if no image files exist

Posted: 11 Nov 2022 17:23
by admin
That was added not sooo long ago (v22.70.0022 - 2022-01-20 18:51, see also viewtopic.php?f=2&t=24090) and sorry for the bad grammar. I'll look into it...

... well, unfortunately I cannot confirm it. Works well, the cache files are removed on "Refresh Thumbnails". :?

Re: Refresh thumbs delete cache files if no image files exist

Posted: 11 Nov 2022 18:18
by klownboy
Hey Don, you're right under one circumstance. If the folder has one or more non-cacheable files remaining in the folder after you delete the cacheable images, the 2 associated cache files are deleted. But, if the folder contains only cacheable images, such that all files are deleted in that folder, it does not work. It would be nice if it did.

Re: Refresh thumbs delete cache files if no image files exist

Posted: 11 Nov 2022 18:25
by admin
You mean on "Refresh Thumbnails" when the folder is completely empty? Works as well. :)

Re: Refresh thumbs delete cache files if no image files exist

Posted: 11 Nov 2022 18:42
by klownboy
Yes, I was talking about the same situation, using "Refresh Thumbnails" after deleting the cacheable files. But I appear to be all wet, in that in re-testing after deleting all files cacheable and non-cacheable, the 2 thumbnail cache files are being deleted. I don't know why it wasn't working for me earlier today or last week. I may make a short script to run some additional tests to make sure it's consistent that way as well. Thanks, and sorry Don. :whistle:

Re: Refresh thumbs delete cache files if no image files exist

Posted: 11 Nov 2022 18:45
by admin
I'm sure you experienced that. You just have to find all the right conditions. Looking at the code I cannot see a way how this can't work though.