Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to read Lightroom keywords from image file using PHP?

I have a photo community (www.jungledragon.com) that allows users to upload photos. My platform is PHP/CodeIgniter.

As part of the upload process I'm already reading EXIF info using PHP's exif_read_data function, which works fine. I read camera details and show these on an info tab.

On top of that, user's are expected to manually set the photo title, description and tags on the website after uploading the photo. However, some users manage these fields in their image management program, for example Lightroom. It would be great if I could read those as well, uploading would become a total joy.

I already improved my EXIF reading to read the "caption", this way users don't have to set the image title after uploading anymore. Now I'm looking to read keywords, which is where I am stuck. Here's a partial screenshot of an image in Lightroom:

enter image description here

I can read the Metadata, but how do I read the keywords? The fact that it is not inside metadata makes me wonder if it's at all possible? I've tried reading every value I can get (ANY_TAG, IFD0, EXIF, APP12) using exif_read_data, but the keywords are not to be found.

Any thoughts?

like image 672
Fer Avatar asked Feb 23 '23 06:02

Fer


1 Answers

As suggested you may have to use another method of reading metadata.

http://www.foto-biz.com/Lightroom/Exif-vs-iptc-vs-xmp

Image keywords may be stored in IPTC and not in EXIF. I don't know if there is a standard platform method for reading iptc but a quick google shows this

http://php.net/manual/en/function.iptcparse.php

like image 97
Anders Forsgren Avatar answered Mar 02 '23 00:03

Anders Forsgren