Slow thumbnails

Features wanted...
admin
Site Admin
Posts: 60604
Joined: 22 May 2004 16:48
Location: Win8.1 @100%, Win10 @100%
Contact:

Re: Slow thumbnails

Post 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.

kileytoo
Posts: 53
Joined: 30 May 2012 22:10

Re: Slow thumbnails

Post by kileytoo »

admin wrote:UPDATE: Yep, bug found and fixed! :tup: :cup:
great! :D

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

Re: Slow thumbnails

Post 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.

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

Re: Slow thumbnails

Post 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.
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

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

Re: Slow thumbnails

Post by admin »

Sure, that's how it's supposed to work. :D

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

Re: Slow thumbnails

Post 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");
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

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

Re: Slow thumbnails

Post by admin »

You seem to write literal hex values to the file. Hmmm... :eh:

Hint: viewtopic.php?p=155623#p155623

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

Re: Slow thumbnails

Post 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 :) )
Windows 11, 23H2 Build 22631.3447 at 100% 2560x1440

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

Re: Slow thumbnails

Post 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.

kileytoo
Posts: 53
Joined: 30 May 2012 22:10

Re: Slow thumbnails

Post 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. :|

jupe
Posts: 2801
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Slow thumbnails

Post 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

kileytoo
Posts: 53
Joined: 30 May 2012 22:10

Re: Slow thumbnails

Post 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...

jupe
Posts: 2801
Joined: 20 Oct 2017 21:14
Location: Win10 22H2 120dpi

Re: Slow thumbnails

Post 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.

kileytoo
Posts: 53
Joined: 30 May 2012 22:10

Re: Slow thumbnails

Post 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.

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

Re: Slow thumbnails

Post 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?

Post Reply