Skip to main content
hobster12345
Inspiring
March 30, 2017
Answered

accessing preview images

  • March 30, 2017
  • 1 reply
  • 1581 views

Is there a way to access and use the smart previews or the regular previews that Lightroom creates?

Best would be to use the previews in php. But for a start any other programming language e.g. java would also be ok.

Reason why I am asking is, I want to have a WebInterface for Lightroom in my LAN (not Internet)

For now I create thumbnails and images myself using regular export function of lightroom.

But this is extra work to do.

Thank you

This topic has been closed for replies.
Correct answer hobster12345

One approach is to write a Lua script that uses photo:requestJpegThumbnail() to extract the previews in JPEG format and write the previews to a file or send them over the network.

Another approach is to use directly examine the catalog database and the previews database to extract the preview for each desired photo.  Both databases are SQLite databases, and since they are undocumented and direct access is unsupported by Adobe, building a system on that is likely to be more fragile than one built on a Lua script.  There are a few plugins around that take this approach, e.g. Jeffrey Friedl's Blog » Jeffrey’s “Extract Cached Image Previews” Lightroom Plugin and LRViewer.


found it, lrprev files are just text files that have basic information and several jpg representations in different resolutions of the jpg and you can read the string of the jpg information and use it for presenting the jpg.

1 reply

johnrellis
Legend
March 30, 2017

See the method photo:requestJpegThumbnail().  Also, search this forum and the official Adobe feedback forum for that method, since some developers reported having issues with how it works (as of a couple years ago).

hobster12345
Inspiring
March 31, 2017

Thank you very much.

I was looking for some way to decode the files and use it directly for my webgallery or webinterface.

I assume that the method you are mentioning is part of lua. Maybe my post is not in the right section and should not be part of lightroom sdk.

johnrellis
Legend
March 31, 2017

One approach is to write a Lua script that uses photo:requestJpegThumbnail() to extract the previews in JPEG format and write the previews to a file or send them over the network.

Another approach is to use directly examine the catalog database and the previews database to extract the preview for each desired photo.  Both databases are SQLite databases, and since they are undocumented and direct access is unsupported by Adobe, building a system on that is likely to be more fragile than one built on a Lua script.  There are a few plugins around that take this approach, e.g. Jeffrey Friedl's Blog » Jeffrey’s “Extract Cached Image Previews” Lightroom Plugin and LRViewer.