Metadata - inserting Fullpath to image into 'File Name' field

  • Thread starter Thread starter Jonathon Batson
  • Start date Start date
Status
Not open for further replies.
J

Jonathon Batson

Guest
Hi
I want to put the full path to alot of images into a Metadata field.
File Name, I guess should just hold the image file name but where and how could I
store the full path to the file.
I can put the Folder into the Filename field but have not been able to do the Full Path anywhere
Is there a way this can be done.

Also .. is there a way to get the correct sytax for the path. When I edit the custom field
for the File Name metadata and insert a / between Folder and Filename it adds a dash after
saving the Custom Field.

thanx
 
Hi Johnathon

A question and an answer:

How would you use the full path to the file in the metadata? There may be a better way.

The operating system won't allow slashes in file names because they are used by the OS as directory separators in a path. Lightroom treats certain characters as illegal in file names, as shown in Preferences on the File Handling tab, and slashes are in that list for that reason. Also on the same tab is a dropdown list of characters illegal characters are replaced with and your preference is probably set to use a dash.
 
I have a large portable HDD of images that has been sorted into selections in Lightroom. The plan is to use a plugin to export these selections to gallery in a lower resolution using https://sourceforge.net/projects/lr-to-gallery/ which will give our network users access to the images on gallery but not the original.
The idea was to have the full path in a meta data field so a user could see it in gallery when viewing the image. Then if they need to pull the orig they have the location of it.
 
I have a large portable HDD of images that has been sorted into selections in Lightroom. The plan is to use a plugin to export these selections to gallery in a lower resolution using https://sourceforge.net/projects/lr-to-gallery/ which will give our network users access to the images on gallery but not the original.
The idea was to have the full path in a meta data field so a user could see it in gallery when viewing the image. Then if they need to pull the orig they have the location of it.
Jonathon, welcome to the forum. We hope that you will get a satisfactory solution, to assist us can you take a moment to fill in your signature in the UserCP. Thanks.
 
Jonathon, the way I think I'd do that is to use exiftool as an Export Action, or through Jeffrey Friedl's "Run Any Command" piglet. Something like
Code:
exiftool -iptc:jobid=%d%d.%e
That will stick the full path, filename, and extension into the IPTC JobID field.

(Disclaimer: I didn't test that, but I think that's pretty close to the right syntax.)
 
@Mark
Very helpful tips .. thanx
I can use exiftool to edit the meta data no problem. Although the %d for dir part I could not get working, but some bash magic resulted in
Code:
find /home/jonathonb/tmp -type f -maxdepth 2 -iname '*.jpg' -exec exiftool -UserComment='{}' {} \;
Which is fine .. but .. I would rather not run the exiftool across the entire Removable HDD of ~6' ''' images when the Lightroom Selections are going to be more like 1 ''' total. So I need to run exiftool at the time of the upload to gallery export for each item.

And using the Lua code snipit below from Jeffrey Friedl's "Run Any Command" piglet, I can run a system command just before the upload of an image to Gallery.
(Inserted into the Lightroom to Gallery Plugin that is: in the file GalleryRemoteProtocol.lua , function uploadImage
Lua code snipit:
Code:
-- note imagePath is a paramater passed to the function
local cmd = [COLOR=#dd'''']"exiftool -UserComment='"[/COLOR] .. imagePath .. [COLOR=#dd'''']"'"[/COLOR] .. imagePath
local returnval = LrTasks.execute(cmd)
This works fine but .. the issue is now I have come to realize that Lightroom actually makes a copy of the image and does not reference the original image. So the Lightroom variable imagePath refers to the tmp items path, which is something like
/var/tmp/folders.29234/TemporaryItems/32914FCA-B'34-449C-9DC3-127A259D94EA/1''2'7ae_t.jpg
rather than the real image path on the Removable HDD

So my question would be: in Lightroom is there a way to find the original image location in Lua?

(I realize this thread is bordering on being moved to the plugins section btw)
 
Oh, are you looking for the full path to the original file, or to the exported file? If it's the original file, I think you're gonna be hard pressed to make that happen at export time. My approach there would be to use exiftool to put the path into the metadata before import, perhaps doing an ImageIngester-like thing to copy files from the card to disk and adjust the metadata before import.

If you're looking for the full path to the exported file, then read on.

I think your question would be better asked and answered on the Export API forum, but I'd still be inclined to pursue using exiftool as an Export Action or through Run Any Command. Just seems simpler to me.

I did have a typo back there, should be %d%f.%e, not %d%d.%e.

I thought that Run Any Command's "{FILE}" parameter is the full path to the exported file, and I'd think exiftool's %d%f.%e approach should work too. Perhaps sometime today I can try to experiment.
 
I can see the option of using the exiftool to put the path into the metadata before import is looking at being at the top of the list atm.
The issues I have with this is
(A) that I would have to run it on all 6' ''' images, when there will only be 1''' images being exported from Lightroom to Gallery.
(B) also there is no backup for the 6' ''' images and also no extra space , so the exiftool "-overwrite_original" option would have to be used and this would increase the possibility of something going wrong and possibily loosing/corrupting some images, which I would rather not risk.
So the problem loops back to running the exiftool only on the selection list in lightroom, which means getting the path to the original file.
I am going to raise this question it the Export API forum to see if there are any other possibilities.

Thanx again for you help.
 
While you're awaiting an answer, I would suggest filing a feature request. I too (many moons ago) filed a feature request to be able to set metadata from other metadata; my example was a wish to set IPTC Title equal to the filename. The more of us making this request, the more likely it is to happen.
 
Status
Not open for further replies.
Back
Top