North American Nature Photography Association

Connecting The Nature Photography Community


Old 05-30-2010, 03:42 PM
plunkettphoto plunkettphoto is offline
NANPA Board Member
Join Date: Jul 2009
Location: Judson, TX
Posts: 21
Default Lightroom Catalog Table Structure

Some of you know that I am an old gray-beard programmer from a prior life. Well I decided to build an application for my own in-house use that reads information from a Lightroom Catalog. Doubt that it will ever be a commercially viable app but then you never know.

I need to read information from the LR catalog (actually, a copy of the catalog) which is actually a SQLite RDBMS. I can find all the information I am looking for in the various cryptic tables in the database. Problem is I can't figure out how to tie the rows in the various tables together for a particular image. Most tables contain fields for id_local and id_global but they don't match across tables.
I thought it would be obvious how the tables were structured by creating a catalog with only 3 images in it with very clear caption and title information in each. This is how I know that what I thought would be the primary keys (tied to a particular image) don't contain the same values.
Does anyone know how the tables are structured, or where they are documented or who I can contact for more information?
bill plunkett
William (Bill) Plunkett
NANPA Board Member
Reply With Quote
Old 06-06-2010, 03:03 PM
rmklass rmklass is offline
Photo Adventurer
Join Date: Jun 2009
Location: New City, NY
Posts: 39
Default Lightroom Metadata

Are you looking for a way to read out the metadata of the images? I've had good success reading the metadata out with PHP using the GD Image Library resizing function. This doesn't take the library as the input, but rather strips the metadata from the actual files - maybe this would be an option? I use in my website's internal programming to resize images and load metadata into searchable MySQL tables used in the programming of the site.

Let me know if you need help in figuring this.


Raymond Klass Photography and Workshops
Reply With Quote
Old 06-20-2010, 06:56 PM
plunkettphoto plunkettphoto is offline
NANPA Board Member
Join Date: Jul 2009
Location: Judson, TX
Posts: 21

Hi Ray,

thanks for reply. I have got my method worked out now. I really didn't what to have to navigate through all image files in my folders. I have a SQLite database for images that are either at my stock agent or that I sell prints of. These images are all identified with an ImageID number that has been included in a custom metadata field in the LR Catalog. That way I can use my SQL app and access only the image records in the LR catalog that have an ImageID. After some time spent "hacking" the catalog structure I've got it all sorted out. Unfortunately, the only way to get to a couple of the fields like Title and Caption is to parse the XMP data stored in one of the tables. This would be the same data you are accessing by reading the metadata from the image file itself. LR stores a copy of the XMP in a field in the SQL table. The parsing is a little messy but it does get to all the data I need in my application, being prototyped in REALBasic but will actually be written in XCODE (Objective-C)

see you later Ray,
William (Bill) Plunkett
NANPA Board Member
Reply With Quote

lightroom, software, technical

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Enabled for iPhone,Android,Nokia
Enabled for iPhone,Android,Nokia
Click for App

All times are GMT -5. The time now is 06:51 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2016, vBulletin Solutions, Inc.

Web site design © Relevant Arts