Slow thumbnails
-
highend
- Posts: 14955
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Slow thumbnails
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
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".
FAQ | XY News RSS | XY X
-
highend
- Posts: 14955
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Slow thumbnails
Code: Select all
function ConvertToVBDate(date) {
...
return result
}Code: Select all
text ConvertToVBDate("24.01.2018 11:08:02")Code: Select all
0A 12 45 FE 7A 01 87 1DOnce 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
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
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.
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
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!highend wrote:Code: Select all
function ConvertToVBDate(date) { ... return result }outputs:Code: Select all
text ConvertToVBDate("24.01.2018 11:08:02")or whatever would match for that exampleCode: Select all
0A 12 45 FE 7A 01 87 1D
Once we see how the converting is done, we can expand / modify the function ourselves...
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 FAQ | XY News RSS | XY X
-
klownboy
- Posts: 4462
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
Re: Slow thumbnails
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.
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
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.
FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 66366
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Slow thumbnails
Yes, confirmed, there is something fishy. I'll check that later...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.
UPDATE: Yep, bug found and fixed!
FAQ | XY News RSS | XY X
-
highend
- Posts: 14955
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Slow thumbnails
That's good enough, thanks!text hexdump(formatdate("24.01.2018 11:08:02", "8char"),,"r"); //69 0E 5E D8 8E 0E E5 40
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
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.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.
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:
-
klownboy
- Posts: 4462
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
Re: Slow thumbnails
On your beta example: 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?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.
Code: Select all
text hexdump(formatdate("24.01.2018 11:08:02", "8char"),,"r"); //69 0E 5E D8 8E 0E E5 40 So in the case of the VB date in the dat2 file script would this work?
Code: Select all
$VBdate = hexdump(formatdate(, "8char"),,"r");-
admin
- Site Admin
- Posts: 66366
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Slow thumbnails
Yes, a language thing.
No, the hexdump is just for visual check. For your purpose you use it like this:
No, the hexdump is just for visual check. For your purpose you use it like this:
Code: Select all
$VBdate = formatdate(, "8char");FAQ | XY News RSS | XY X
-
admin
- Site Admin
- Posts: 66366
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Slow thumbnails
BTW, it would be easy for me to add a scripting command that does the whole job:
Interested?
Code: Select all
Syntax: ThumbsCacheRename PathOld, PathNewFAQ | XY News RSS | XY X
-
klownboy
- Posts: 4462
- Joined: 28 Feb 2012 19:27
- Location: Windows 11, 25H2 Build 26200.8737 at 100% 2560x1440
Re: Slow thumbnails
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.
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.
XYplorer Beta Club