I looked at the size of my XY "thumbnails" folder the other day and couldn't believe how large it had grown. On the laptop it was 1.4 gig and on the desktop it was over a 1.5 gig...way too much picture taking on trips I suppose.
Don had mentioned earlier in this thread that he may institute some thumbnail cleanup tool when he gets some time. In the meantime more as a learning tool for me, I'm attempting to come up a with a script that would look a the XYthumbs.txt file located in XY's thumbnails folder and allow the user to look at the entries and then select those thumbnail files (based on the locations and thumbnail sizes) which he wishes to delete. Note: It would be nice to grab the "date" from the actual files and put that in the inputselect list along side of the associated folder location and thumbnail size, but maybe later.
Code: Select all
$selected = "";
$thumbstxt = readfile("<xythumbs>\XYthumbs.txt");
$sel_hash = inputselect("Select Thumbnails files to delete<crlf>based on thumbnail size and folder location.", $thumbstxt, "<crlf>", 2, , 700, 600, "Thumbnail File Selection");
foreach($hash, $sel_hash, <crlf>)
{
$hash = gettoken($hash, -1, "|"); //extract the hash only portion of line
$selected = $selected . $hash . "<crlf>"; //for testing only
delete 0, 1, "<xythumbs>\". $hash .".*"; //using "1" to confirm deletion for testing only, but will change to "0" to avoid all the prompts when multiples selected
}
//text $selected; //for testing only
$newthumbs = formatlist($thumbstxt, "f", "<crlf>"), !"$sel_hash"); //trying to filter out the lines for the files which were deleted.
text $newthumbs;
//writefile("<xythumbs>\XYthumbs.txt", $newthumbs);
Thanks,
Ken
The latest version 1.20 is available here viewtopic.php?p=204361#p204361
XYplorer Beta Club