Slow thumbnails

Features wanted...
highend
Posts: 14955
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Slow thumbnails

Post by highend »

8 bytes in hex would probably the best option
One of my scripts helped you out? Please donate via Paypal

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

Re: Slow thumbnails

Post by admin »

Give me an example how you would use them. XY scripting has no data typing so I'm not sure what you expect when you say "8 bytes in hex".

highend
Posts: 14955
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Slow thumbnails

Post by highend »

Code: Select all

function ConvertToVBDate(date) {
	...
	return result
}

Code: Select all

text ConvertToVBDate("24.01.2018 11:08:02")
outputs:

Code: Select all

0A 12 45 FE 7A 01 87 1D
or whatever would match for that example

Once we see how the converting is done, we can expand / modify the function ourselves...
One of my scripts helped you out? Please donate via Paypal

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

Re: Slow thumbnails

Post by kileytoo »

Sorry to cut in, the scripts are very interesting and definitely useful. I was able to reproduce the issue in which thumbnails are recreated when it is not needed...

Usually if I rename or move a folder within XYplorer, the thumbs are not recreated, as expected. However sometimes they are, for example in this scenario. Let's say you have three folders

A────
 └ B──
    └ C─


with the image files in C. If you create a new folder under A, for example BB, and move C under it the thumbs are always recreated. It only happens if BB is new and was not visited before. If you click on BB first, and then move C there, the thumbs are not recreated, as expected. There may be other scenarios, this is the one I was able to catch and reproduce.

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

Re: Slow thumbnails

Post by admin »

highend wrote:

Code: Select all

function ConvertToVBDate(date) {
	...
	return result
}

Code: Select all

text ConvertToVBDate("24.01.2018 11:08:02")
outputs:

Code: Select all

0A 12 45 FE 7A 01 87 1D
or whatever would match for that example

Once we see how the converting is done, we can expand / modify the function ourselves...
Ah, you mean to do the conversion through scripting. Well, that's kind of hard. VB date seems to be the nanoseconds passed since 1899-12-30 00:00:00. Crazy!

I can give you a function that converts any date into an 8 character string that you can write to that DAT file. But all the math and calendar knowledge going on here is not exposed.

I added the special format "8char" to SC hexdump. This will work in next beta, and the hexdump will show you the 8 hex values:

Code: Select all

text hexdump(formatdate("24.01.2018 11:08:02", "8char"),,"r"); //69 0E 5E D8 8E 0E E5 40 

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

Re: Slow thumbnails

Post by klownboy »

Concerning the date fomat, I noticed on the second line of the thumbs.txt file, the date format is: 2018-01-23 14:00:36

That date must be written when the log is changed after performing a Thumbnail refresh CID #501. I say that 'cause I'm not sure which format is used in the dat2 file or if in the end they are the same when translated to hex. :?:

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

Re: Slow thumbnails

Post by admin »

Those dates are not necessarily the same. The the log is written only when a new cache is added, not when a cache is updated.

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

Re: Slow thumbnails

Post by admin »

kileytoo wrote:Sorry to cut in, the scripts are very interesting and definitely useful. I was able to reproduce the issue in which thumbnails are recreated when it is not needed...

Usually if I rename or move a folder within XYplorer, the thumbs are not recreated, as expected. However sometimes they are, for example in this scenario. Let's say you have three folders

A────
 └ B──
    └ C─


with the image files in C. If you create a new folder under A, for example BB, and move C under it the thumbs are always recreated. It only happens if BB is new and was not visited before. If you click on BB first, and then move C there, the thumbs are not recreated, as expected. There may be other scenarios, this is the one I was able to catch and reproduce.
Yes, confirmed, there is something fishy. I'll check that later...

UPDATE: Yep, bug found and fixed! :tup: :cup:

highend
Posts: 14955
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Slow thumbnails

Post by highend »

text hexdump(formatdate("24.01.2018 11:08:02", "8char"),,"r"); //69 0E 5E D8 8E 0E E5 40
That's good enough, thanks!
One of my scripts helped you out? Please donate via Paypal

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

Re: Slow thumbnails

Post by klownboy »

admin wrote:Those dates are not necessarily the same. The the log is written only when a new cache is added, not when a cache is updated.
OK, thanks Don. You probably told me that a few years ago. So in this particular case where I'm rewritting the dat2 file with the new folder information and renaming the dbits file with the new hash, I should be updating XYthumbs.txt.

On second thought since there's an existing entry for the old "folder|thumb|hash", instead of deleting the entry and writing a new one, I could modify the existing one (i.e., change the folder path and hash, but keeping the thumbnail size since it doesn't change.

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

Re: Slow thumbnails

Post by admin »

Should work.

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

Re: Slow thumbnails

Post by klownboy »

On your beta example:

Code: Select all

text hexdump(formatdate("24.01.2018 11:08:02", "8char"),,"r"); //69 0E 5E D8 8E 0E E5 40 
I had to use "-' instead of "." I assume that's simply a language thing. When I changed the "." to "-", I got the right answer.

So in the case of the VB date in the dat2 file script would this work?

Code: Select all

$VBdate = hexdump(formatdate(, "8char"),,"r");
Since "8char" is the format field, I assume will that give me the format result needed for the dat2 file - writing the 8 bytes starting at 277.

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

Re: Slow thumbnails

Post by admin »

Yes, a language thing.

No, the hexdump is just for visual check. For your purpose you use it like this:

Code: Select all

$VBdate = formatdate(, "8char");

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

Re: Slow thumbnails

Post by admin »

BTW, it would be easy for me to add a scripting command that does the whole job:

Code: Select all

Syntax: ThumbsCacheRename PathOld, PathNew
Interested?

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

Re: Slow thumbnails

Post by klownboy »

Interested? Yes, sure I would. I've spent a bit of time on this and it all works (minus the VBdate input). I even got the XYthumb.txt file updated, but I can chock it up as another good learning experience. Besides I'd still have to put the new SC in a script. The "z" Zoom-to-fill designation in the dat2 file isn't affected. I haven't checked on 'paper', but I'm not concerned about the paper designation really. Thanks Don.

Edit: Obviously, it's up to you Don. I spent some time on it and started wondering why since not many (including me) would end up using it at least not very often. It would have been helpful when I setup a new laptop and the all my images were on a different drive than the desktop. So I guess it depends on how much work is involved.

Post Reply