• Welcome to the Lightroom Queen Forums! We're a friendly bunch, so please feel free to register and join in the conversation. If you're not familiar with forums, you'll find step by step instructions on how to post your first thread under Help at the bottom of the page. You're also welcome to download our free Lightroom Quick Start eBooks and explore our other FAQ resources.
  • Stop struggling with Lightroom! There's no need to spend hours hunting for the answers to your Lightroom Classic questions. All the information you need is in Adobe Lightroom Classic - The Missing FAQ!

    To help you get started, there's a series of easy tutorials to guide you through a simple workflow. As you grow in confidence, the book switches to a conversational FAQ format, so you can quickly find answers to advanced questions. And better still, the eBooks are updated for every release, so it's always up to date.
  • 17 August 2023 It's Lightroom update time again! See What’s New in Lightroom Classic 12.5 & Cloud Service (August 2023)? for all the update news. This release contains a fix for the Edit In... Photoshop issues as well as support for the new Sony A6700 camera.

Hash algorythm for previews?

Status
Not open for further replies.
Joined
May 9, 2015
Messages
1,877
Location
Palo Alto, CA
Lightroom Experience
Power User
Lightroom Version
Classic
Lightroom Version
All
Operating System
  1. Windows 7
  2. Windows 8
  3. Windows 10
  4. Windows 11
  5. macOS 10.13 High Sierra
  6. macOS 10.14 Mojave
  7. macOS 10.15 Catalina
  8. macOS 11 Big Sur
  9. macOS 12 Monterey
  10. macOS 13 Ventura
This is an academic question which is pretty techie, but does anyone know what metadata is considered by LrC when it creats the folders and file names for previews?

For example, If I change the file name or capture date does this alter the folder or file name for the preview? Will the same image always get the same preview folder and file name if imported into different catalogs? or if the same original image was in different different place in the folder tree? Etc.

Thanks -- Dan
 
Joined
Jun 20, 2009
Messages
20,154
Location
Houston, TX USA
Lightroom Experience
Power User
Lightroom Version
Cloud Service
I think the process is fixed. The preview folder contains another database for indexing. You can view it using any SQLLite browser.
Imported images are assigned a unique key in LrC and this is used to index the location of the preview. This would never change no matter what metadata is changed.


Sent from my iPad using Tapatalk
 
Joined
Jun 20, 2009
Messages
20,154
Location
Houston, TX USA
Lightroom Experience
Power User
Lightroom Version
Cloud Service
Thanks Cletus. Is the "unique key" for the image in the catalog just a squential number or is it a derived number?

It has been a while since I looked at the LrC Database table but my recollection is that the image index key is sequential. Using SQLLite database manager to investigate both will reveal lots of useful information.


Sent from my iPad using Tapatalk
 
Joined
Oct 8, 2007
Messages
6,418
Location
London
Lightroom Experience
Power User
I think it's semi-derived but only upon import. So the same image is assigned different UUIDs if it's imported into different catalogues or is imported more than once (ie removed and reimported) into the same catalogue, as here:

891BA77C-C7F0-4E98-9CE5-715089770808
8EFA55FC-E063-452B-8056-701058CBDB09
 
Joined
Jan 18, 2009
Messages
2,584
Location
Fort Myers, FL
Lightroom Experience
Advanced
Lightroom Version
Classic
That's my recollection as well, underneath it'sa guid and that determines (I do not recall how) the hashing so they shouldn't move around. I figured this out a bazillion years ago (I think LR 4) as part of a validation routine, so if it becomes a real issue for you, I can probably look back through the code and figure it out again. If I can remember C#, which I do not think I've used since then.
 
Joined
Oct 8, 2007
Messages
6,418
Location
London
Lightroom Experience
Power User
This script shows the UUID:

--[[ Finds UUID of selected file SETUP INSTRUCTIONS Temporarily save this file onto your desktop and call it "YOURFILENAME.lua". Now you need to create a scripts folder: In Lightroom, choose Lightroom > Preferences (Mac OS) or Edit > Preferences (Windows). Choose the Preset tab and select Show Lightroom Presets folder. Create a folder in the Lightroom folder called Scripts. Copy the "YOURFILENAME.lua" script into the Scripts folder. Quit and reopen Lightroom. You should now see a little scripts menu to the right of the Help menu. It has a single item Title case keywords. --]] local LrTasks = import 'LrTasks' local catalog = import "LrApplication".activeCatalog() local LrDialogs = import 'LrDialogs' local LrView = import 'LrView' LrTasks.startAsyncTask( function() local photo=catalog:getTargetPhoto() varFile = photo:getRawMetadata('uuid') local f = LrView.osFactory() local c = f:row{ bind_to_object = props, f:column { f:edit_field { value = varFile, width_in_chars = 30, height_in_lines = 4 }, }, } dialogValue = LrDialogs.presentModalDialog( { title = "UUID" , contents = c, } ) end)
 
Joined
Oct 8, 2007
Messages
6,418
Location
London
Lightroom Experience
Power User
It's always worked, but there is no documentation about it, so it depends how one defines "supported". However the code is the same scripting language built into Lightroom and used by plugins.
 
Last edited:
Joined
Oct 8, 2007
Messages
6,418
Location
London
Lightroom Experience
Power User
Almost, but you're limited by everything being in a single file, getting values from dialog boxes is difficult, and you can't store preferences for how the script should work. The method is best for little standalone tasks like here.
 
Status
Not open for further replies.
Top