write metadata to psd from php script

Started by Archive, May 12, 2010, 08:54:19 AM

Previous topic - Next topic

Archive

[Originally posted by paulgodard on 2008-04-10 21:02:02-07]

Hi

Along many years I have developed a mysql/php imagebank.  Of course it is less powerful than Adobe LighRoom.  So now I would like to export my data into LR.  Most of the data can be imported into the metadata of my image files (mainly psd files but also tif or jpg).  I have about 40000 images that need processing.

The ideal approach for me is to write a script in php that will retrieve the data for each images and write the metadata (title, location, country, date, exposure...) into the psd file.  I have already downloaded and installed ExifTool on my Mac but at first look, it seems a bit complex.  

Does someone has done such thing before?

Paul

Archive

[Originally posted by exiftool on 2008-04-11 10:58:35-07]

Hi Paul,

I think the only easy way to do this is to run the exiftool
executable from within your php script.  If you are in Windows,
there may be an issue with the maximum length for a command
line, which could be a problem if you are writing a large number
of tags.  If this happens, then you can always write the exiftool
command-line arguments to a file from php, then use the
-@ option when running exiftool to read the arguments
from file.

- Phil

Archive

[Originally posted by paulgodard on 2008-04-12 07:51:27-07]

Thank you Phil

I am already moving forward but I am struggling to find the right tag names.  Can someone help me to find the correct IPTC tag names for :

  ISO CountryCode that can also accept 2 car codes (i.e. ZA for South Africa)

  Country (name)

  City

  Caption

  Label

Here is the command line I am using :

exiftool -Rating="2" -Location="Farmland" -State="Brabant" -Country="Belgium" -ISOCountryCode="Belgium" -City="Nethen" -Title="farm fence at sunset" -Caption="Moonlight Shadow" -Label="1" -overwrite_original_in_place PG_000076.psd

It is working without error except for the tags above.

Now I am want to move to have exiftool reading an external file with several command lines.  Can you please confirm the syntax within the text file.

exiftool -@ ListCommands.txt

and within the file ListCommands.txt

-Rating="2" -Location="Farmland" ... PG_000076.psd (first line)

-Rating="1" -Location="Texaco" ... PG_000077.psd (first line)

-Rating="3" -Location="Brussels" ... PG_000078.psd (first line)

and so on...

Paul

Archive

[Originally posted by exiftool on 2008-04-12 14:15:03-07]

Hi Paul,

Check the https://exiftool.org/TagNames/IPTC.html" target="_blank">IPTC
Tag Names documentation for the correct tag names to use.

There must be only one argument per line in the -@ file.
Also, if you want different arguments for each file, then they must
be executed as separate commands, but the good news is you can
use the -execute option to do this.  So your file should look
more like this instead:

Code:
-Rating="2"
-Location="Farmland"
...
PG_000076.psd
-execute
-Rating="1"
-Location="Texaco"
...
PG_000077.psd
-execute
-Rating="3"
-Location="Brussels"
...
PG_000078.psd

- Phil