Page 5 of 6

Re: Slow thumbnails

Posted: 25 Jan 2018 07:58
by admin
Sorry for that! I don't know why I didn't have the idea earlier, well, maybe to grant you that learning experience. :) It should not be much work, I'll give it a shot today.

Re: Slow thumbnails

Posted: 25 Jan 2018 08:51
by kileytoo
admin wrote:UPDATE: Yep, bug found and fixed! :tup: :cup:
great! :D

Re: Slow thumbnails

Posted: 25 Jan 2018 09:42
by admin
kileytoo wrote:
admin wrote:UPDATE: Yep, bug found and fixed! :tup: :cup:
great! :D
Thank you! That was a really important bug. The fix will save the climate by sparing lots of unnecessary CPU action.

Re: Slow thumbnails

Posted: 25 Jan 2018 12:26
by klownboy
I don't know what you found and fixed on beta v18.70.0001, but XY ts doing a great job now on updating the thumbnail cache files on folder moves. So much so that it's making it hard to test the script for updating the cache. I've been making moves like "e:\temp\two\" to "g:\main\\two\" and the caches are updating automatically. It probably means I'll have to move the folder outside of XY (i.e., in Windows Explorer) to test the script or your new SC ThumbsCacheRename.

Re: Slow thumbnails

Posted: 25 Jan 2018 16:22
by admin
Sure, that's how it's supposed to work. :D

Re: Slow thumbnails

Posted: 25 Jan 2018 18:18
by klownboy
Hi highend, I incorporated Don's update to SC formatdate in the script which writes a new dat2 file based on the folder change. It appears to be to working fine in my own script. I was hoping you'd take a look to make sure I didn't screw something up. Here is a modified version of what you provided. I wasn't too positive about trailing backspaces you mention. The hex dump of $VBdate (8 bytes) has a trailing backspace so I didn't add it in that line. I assume I needed the hexdump of $VBdate since the rest of the line is in hex format. I used a $VBdate start postion of 8 bytes from 277-284 with the remainder of the file, $footerDat2File starting at 285. This seems to be working though. When I enter the image folder after it's use the thumbnail are not regenerated.

To test, I accomplished the folder moves outside of XYplorer using Explorer to ensure XY wasn't automatically updating the cache file. Thanks.

Code: Select all

    $srcFileContent = readfile($srcFile, "r");
    $hexSrcFileContent = hexdump($srcFileContent, 1, "r");     // Has trailing space
    $headerSrcFile = gettoken($hexSrcFileContent, 16, , , 1);  // No trailing space
// $footerSrcFile = gettoken($hexSrcFileContent, 277, , , 2); // Has trailing space
    $footerSrcFile = gettoken($hexSrcFileContent, 285, , , 2); // Has trailing space
    $VBdate = hexdump(formatdate(, "8char"),,"r");   // Has trainling space.

    $newPath = "R:\a new folder where items are stored\*96x72";
    $hexNewPath = hexdump($newPath, , "r");                    // Has trailing space
    $cntHexNewPath = gettoken(trim($hexNewPath), "count");
    $toPad = 276 - $cntHexNewPath - gettoken($headerSrcFile, "count");
// $hexDstFileContent = $headerSrcFile . " " . trim($hexNewPath) . strrepeat(" 20", $toPad) . " " . $footerSrcFile;
    $hexDstFileContent = $headerDat2File . " " . trim($hexNewPathThumb) . strrepeat(" 20", $toPad) . " " . $VBdate . $footerDat2File;
    writefile($dstFile, hexdump($hexDstFileContent, 1, "ri"), , "r");

Re: Slow thumbnails

Posted: 25 Jan 2018 18:27
by admin
You seem to write literal hex values to the file. Hmmm... :eh:

Hint: viewtopic.php?p=155623#p155623

Re: Slow thumbnails

Posted: 25 Jan 2018 18:44
by klownboy
Well yes, I think what highend did originally here viewtopic.php?f=5&t=13863&start=30#p155570 is build the sections of the dat2 file in hex format.

Code: Select all

  $hexDstFileContent = $headerSrcFile . " " . trim($hexNewPath) . strrepeat(" 20", $toPad) . " " . $footerSrcFile;
All those sections are in hex format and then in the next step it is converted with "ri" parameter. There's probably an easier way to accomplish it especially since you've provided the VBdate in the exact format necessary.

Code: Select all

  writefile($dstFile, hexdump($hexDstFileContent, 1, "ri"), , "r");
I'll try it without the hexdump conversions (and see if it still works :) )

Re: Slow thumbnails

Posted: 25 Jan 2018 19:25
by admin
Hex values are a representation of bytes, they almost never appear literally in any files. What you want to write to the file are the bytes, not the representation.

Re: Slow thumbnails

Posted: 12 Feb 2018 09:17
by kileytoo
Just to add that USBDLM is now working fine also on the Windows 8.1 tablet, not sure what the issue was but it was short-lived. :)
I will soon need to look into the maintenance scripts for thumbnails to keep the cache size under control. Is there an official thread or download page?
I was also wondering how the option to cache thumbnails on removable media behaves when running XYplorer from a removable media? I planned to do some testing but haven't found the time yet. :|

Re: Slow thumbnails

Posted: 12 Feb 2018 10:00
by jupe
kileytoo wrote:I will soon need to look into the maintenance scripts for thumbnails to keep the cache size under control. Is there an official thread or download page?
Not official, but you could see if this fits your needs:
viewtopic.php?f=7&t=12257
kileytoo wrote:I was also wondering how the option to cache thumbnails on removable media behaves when running XYplorer from a removable media? I planned to do some testing but haven't found the time yet. :|
Same as usual, they will be created in your Thumbnails folder wherever you have that location set to via:

Configuration | Preview | Thumbnails | Cache thumbnails on disk

Re: Slow thumbnails

Posted: 12 Feb 2018 11:14
by kileytoo
Thanks!
jupe wrote: Same as usual, they will be created in your Thumbnails folder wherever you have that location set
Sorry I should have been more specific. I am running portable installs of XYplorer on removable media with this option ON along with standard installs on local discs with this option OFF and all is good. However, the wording of this option seems to be intended for XYplorer running from a standard installation on a local disk, which makes me wonder: if I turn it off on the portable install, will it still create thumbs for the media it is running from, because it sees it as local, or not? I assume it won't create thumbs for other removable media. Also, will it consider the system/desktop drives as local, and create thumbs there regardless of this option? If so, ideally I would want to be able to turn off creating thumbs on the desktop drives...

Re: Slow thumbnails

Posted: 12 Feb 2018 11:25
by jupe
The location you are running XY from is irrelevant, settings that apply to fixed drives or removable drives will do the same thing whether you are running it from c:\ or from a removable drive.

ie. If running XY from a removal drive it doesn't mean that image files on the same drive become local, they should only be created if "Cache Thumbnails to Disk" and "Include Removable Media" is ticked.

Re: Slow thumbnails

Posted: 12 Feb 2018 13:24
by kileytoo
That's simple enough! Maybe including local disks should be made optional (checked by default), it could be useful when running the program from a removable media.

Re: Slow thumbnails

Posted: 23 Feb 2018 09:49
by admin
kileytoo wrote:That's simple enough! Maybe including local disks should be made optional (checked by default), it could be useful when running the program from a removable media.
Why wouldn't you want to cache thumbs on local disks? ... OK, when you are using XY portably on an alien system, right?