Can you import metadata from an excel database to images (JPG, PSD, TIF) in bulk?

New Here ,
Apr 23, 2012 Apr 23, 2012

Copy link to clipboard

Copied

I am very new to working with metadata. I have a microsoft excel file with the IPTC Core fields I need for each image file.

(Creator, Headline, Description, Keywords, Title, Job Identifier, Credit Line, Source, Rights Usage Terms, Copyright Status and Copyright Notice)

Is there a way to get the metadata into the files without having to copy from a cell into each metadata field individually?

I am hoping some for sort of script, possibly...

Also, if only ONE of these fields needed updating in all of the files (i.e. Rights Usage Terms) can that be done?

I have Bridge 5.1 (and earlier versions CS3/CS4)

TOPICS
Batch, Import and export, Scripting

Views

25.3K

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Valorous Hero , Apr 23, 2012 Apr 23, 2012
This might be of use... DIY Metadata.jsx EDIT: the link is there now: DIY Metadata.jsx

Likes

Translate

Translate
replies 121 Replies 121
Guide ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

Lumigraphics​ Yes presentationPath can be a bummer

StreamNZ

You are missing the namespace to enter the Exif details so it would put the details into fiels associated with the drone fields

Enter:

md.namespace = "http://ns.adobe.com/exif/1.0/";

Before the line:-

md.GPSLatitude = ''; 

The namespace directs what schema you are addressing.

Hope this helps.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

I made that change and it closed Bridge when I ran the script.  I will try it again later and check it to make sure I did not make an entry error.  I looked close and it all seemed correct. 

var thumb = new Thumbnail(file);

md = thumb.synchronousMetadata;

if(thumb.hasMetadata){

md.namespace = "http://www.dji.com/drone-dji/1.0/";

md.RtkFlag = '';

md.RtkFlag =  Flag;

md.RtkStdLon = '';

md.RtkStdLon = StdLon;

md.RtkStdLat = '';

md.RtkStdLat = StdLat;

md.RtkStdHgt = '';

md.RtkStdHgt = StdHgt;

md.namespace = "http://ns.adobe.com/exif/1.0/";

md.GPSLatitude = '';

md.GPSLatitude = Lat;

md.GPSLongitude = '';

md.GPSLongitude = Lon;

md.GPSAltitude = '';

md.GPSAltitude = Hgt;

}else{

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

That looks good. I forgot to say that a restart of Bridge is required if any changes are made to a script.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

SuperMerlin, My GPS data is still not getting updated.  I wanted to double check and make sure the namespace for the [composite] section was not supposed to be something else.

I also discovered that my data has some differences.  I had the ° symbol after Degrees where the existing data in the EXIF has " deg " following the degrees.  This is for Lat and Lon.

Also my Altitude is 148.931 (3 decimal places).  The existing data in EXIF is whole number only (no decimals) and it contains the text " m Above Sea Level" after the altitude. 

So i am going to alter my CSV file to reflect the same format and see if it will accept it.  Any insight will be appreciated.  My CSV file did have Dec Degrees and I have since converted that to DMS.  Now I just need to fix the other minor formatting details.

Below is existing EXIF data that has not yet been updated.

-------------------------------------

[Composite] Aperture: 5.6

[Composite] CircleOfConfusion: 0.011 mm

[Composite] DOF: inf (0.00 m - inf)

[Composite] DateTimeCreated: 2018:12:22 13:00:29

[Composite] FOV: 73.7 deg

[Composite] FocalLength35efl: 8.8 mm (35 mm equivalent: 24.0 mm)

[Composite] GPSAltitude: 148 m Above Sea Level

[Composite] GPSLatitude: 34 deg 57' 6.74" N

[Composite] GPSLongitude: 89 deg 55' 48.98" W

[Composite] GPSPosition: 34 deg 57' 6.74" N, 89 deg 55' 48.98" W

[Composite] HyperfocalDistance: 1.26 m

[Composite] ImageSize: 4864x3648

[Composite] LightValue: 13.3

[Composite] Megapixels: 17.7

[Composite] ScaleFactor35efl: 2.7

[Composite] ShutterSpeed: 1/320

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

If these “composite” tags have come from inspection with ExifTool, it should be noted that they are indrect “computed” tags that are generated on the fly from existing metadata and are not directly available in the file.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

i was viewing the metadata export with MetaData++.  Now I am using ExifGUI.  The first program shows the GPS coordinate as DMS (degrees minutes seconds), BUT Exif GUI shows a complete section for GPS and it shows the GPS coordinates as Decimal Degrees.

So my question is how do I confirm what the actual data is in the images Exif?  I also need to figure out how to write the GPS data back to the image because that seems to be failing.

Data shown by ExifGUI

--------------------

---- EXIF ----

Image Description               : DCIM\100MEDIA\DJI_0002.JPG

Make                            : DJI

Camera Model Name               : FC6310

Orientation                     : Horizontal (normal)

X Resolution                    : 72

Y Resolution                    : 72

Resolution Unit                 : inches

Software                        : v01.07.1641

Modify Date                     : 2018:12:22 13:00:29

Y Cb Cr Positioning             : Centered

Exposure Time                   : 1/320

F Number                        : 5.6

Exposure Program                : Program AE

ISO                             : 100

Exif Version                    : 0230

Date/Time Original              : 2018:12:22 13:00:29

Create Date                     : 2018:12:22 13:00:29

Components Configuration        : -, Cr, Cb, Y

Compressed Bits Per Pixel       : 3.185197909

Shutter Speed Value             : 1/320

Aperture Value                  : 5.6

Exposure Compensation           : 0

Max Aperture Value              : 2.8

Subject Distance                : 0 m

Metering Mode                   : Center-weighted average

Light Source                    : Daylight

Flash                           : No flash function

Focal Length                    : 8.8 mm

Flashpix Version                : 0010

Colour Space                    : sRGB

Exif Image Width                : 4864

Exif Image Height               : 3648

Interoperability Index          : R98 - DCF basic file (sRGB)

Interoperability Version        : 0100

Exposure Index                  : undef

File Source                     : Digital Camera

Scene Type                      : Directly photographed

Custom Rendered                 : Normal

Exposure Mode                   : Auto

White Balance                   : Auto

Digital Zoom Ratio              : undef

Focal Length In 35mm Format     : 24 mm

Scene Capture Type              : Standard

Gain Control                    : None

Contrast                        : Normal

Saturation                      : Normal

Sharpness                       : Hard

Subject Distance Range          : Unknown

Serial Number                   : d3ea87f35e1f17805c95a554bba186a4

GPS Version ID                  : 2.3.0.0

GPS Latitude Ref                : North

GPS Latitude                    : 34.951873°

GPS Longitude Ref               : West

GPS Longitude                   : 89.930273°

GPS Altitude Ref                : Above Sea Level

GPS Altitude                    : 148 m

GPS Processing Method           : MANUAL

XP Comment                      : Type=N, Mode=P, DE=None

XP Keywords                     : v01.07.1641;1.2.0;v1.0.0

Compression                     : JPEG (old-style)

X Resolution                    : 72

Y Resolution                    : 72

Resolution Unit                 : inches

Thumbnail Offset                : 10240

Thumbnail Length                : 10203

Thumbnail Image                 : (Binary data 10203 bytes, use -b option to extract)

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

As I said before use Bridge - File Info - Raw Data

This will show what the correct format is. Do not use anything else!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

Sorry I missed that :0  Viewing FILE INFO>RAW DATA in Bridge is VERY helpful.  

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

The script is only putting in data that is in the CSV file so no altarations are being made.

To see actual fields and what is required in your csv file you need to check your file with Bridge - File Info - Raw Data

There you will find the format that is required.

As Stephen has said the composite fields do not exist and are generated by the program you are using to read the data.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 09, 2019 Feb 09, 2019

Copy link to clipboard

Copied

SuperMerlin

Good afternoon.  I tried to mod this code myself and I am having trouble.  I found out that I need to also update the GPS data for the EXIF block as well as the XMP block.    I looked to see if I made a typo and do not see one.  I don't know if I have to do something different for two different namespaces.  Would you mind looking at my edits and see if you see my error?

Line changes

03. Changed name in Line 3 (added V2 to give me second menu option)

18. Added trim(p[8]),trim(p[9]),trim(p[10])

30. Added ExLat,ExLon,ExAlt to reference new fields (Exif Latitude, Exif Longitude, Exif Altitude

54-60 Added Adobe Namespace reference and additional fields.  I have GPS all caps as that is how they are in the existing Exif Data.

When I run this in Bridge, it just sits there for 1-2 seconds and then Bridge closes. 


#target bridge  

if( BridgeTalk.appName == "bridge" ) { 

var drone = new MenuElement( "command", "Drone Metadata V2", "at the end of Tools" );

}

drone.onSelect = function () {

var csvFile = File.openDialog("Open Comma-delimited File","comma-delimited(*.csv):*.csv;");

if (!csvFile.exists) return;

     csvFile.open('r');

     var data = csvFile.read().split("\n");

    csvFile.close();

    var line = new Array();

    for(var a in data){

        var Q = data.toString();

        if(Q.length > 2) line.push(Q);

        }

for(var z in line){

var p=line.split(',');

droneMetadata(trim(p[0]),trim(p[1]),trim(p[2]),trim(p[3]),trim(p[4]),trim(p[5]),trim(p[6]),trim(p[7]),trim(p[8]),trim(p[9]),trim(p[10]));

}

alert("Batch complete\nDrone Error Log on Desktop\n If any errors occured");

function trim(s){

    return s.replace(/^\s+|\s+$/,'');

    }

function log(message){

var errorLog = File(Folder.desktop + "/Drone Error Log.txt");

errorLog.open("a");

errorLog.writeln(message);

errorLog.close();

   }

function droneMetadata(th,Flag,StdLon,StdLat,StdHgt,Lat,Lon,Hgt,ExLat,ExLon,ExAlt){

var file = new File(new Folder(app.document.presentationPath)+ '/' + trim(th));

if(!file.exists){

    log("File does not exist! " + trim(th));

    return;

    }

var thumb = new Thumbnail(file);

md = thumb.synchronousMetadata;

if(thumb.hasMetadata){

md.namespace = "http://www.dji.com/drone-dji/1.0/";

md.RtkFlag = '';

md.RtkFlag =  Flag;

md.RtkStdLon = '';

md.RtkStdLon = StdLon;

md.RtkStdLat = '';

md.RtkStdLat = StdLat;

md.RtkStdHgt = '';

md.RtkStdHgt = StdHgt;

md.GpsLatitude = '';

md.GpsLatitude = Lat;

md.GpsLongitude = '';

md.GpsLongitude = Lon;

md.AbsoluteAltitude = '';

md.AbsoluteAltitude = Hgt;

md.namespace = "http://ns.adobe.com/exif/1.0/";

md.GPSLatitude = '';

md.GPSLatitude =  ExLat;

md.GPSLongitude = '';

md.GPSLongitude =  ExLon;

md.GPSAltitude = '';

md.GPSAltitude =  ExAlt;

}else{

    log("Cannot write metadata to " + decodeURI(thumb.spec));

    }

};

};

First Lines of CSV file

DJI_0002.JPG,50,0.008,0.007,0.017,34.95187873,-89.93024736,+148.931,34.95187873,-89.93024736,+148.931

DJI_0003.JPG,50,0.008,0.007,0.017,34.95181193,-89.93017817,+149.19,34.95181193,-89.93017817,+149.19

DJI_0004.JPG,50,0.008,0.011,0.015,34.95176096,-89.93012334,+149.67,34.95176096,-89.93012334,+149.67

DJI_0005.JPG,50,0.008,0.006,0.015,34.95170888,-89.93005634,+149.769,34.95170888,-89.93005634,+149.769

DJI_0006.JPG,50,0.008,0.006,0.015,34.95165501,-89.92998616,+149.653,34.95165501,-89.92998616,+149.653

DJI_0007.JPG,50,0.008,0.007,0.016,34.95154082,-89.92984514,+149.955,34.95154082,-89.92984514,+149.955

DJI_0008.JPG,50,0.012,0.019,0.016,34.95148343,-89.92977355,+150.012,34.95148343,-89.92977355,+150.012

DJI_0009.JPG,50,0.008,0.007,0.016,34.95142627,-89.92969896,+149.788,34.95142627,-89.92969896,+149.788

DJI_0010.JPG,50,0.008,0.007,0.016,34.95136721,-89.92962243,+149.572,34.95136721,-89.92962243,+149.572

DJI_0011.JPG,50,0.008,0.006,0.015,34.95130963,-89.92954778,+149.635,34.95130963,-89.92954778,+149.635

DJI_0012.JPG,50,0.008,0.007,0.017,34.95126481,-89.92948684,+149.564,34.95126481,-89.92948684,+149.564

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 10, 2019 Feb 10, 2019

Copy link to clipboard

Copied

I know next to nothing about the GPS format, it looks as if ExifTool might be changing the format for you but the format is incorrect for Bridge.

<exif:GPSLatitude>52,23.5884N</exif:GPSLatitude>

<exif:GPSLongitude>12,36.3339E</exif:GPSLongitude>

<exif:GPSAltitudeRef>0</exif:GPSAltitudeRef>

<exif:GPSAltitude>165779/1000</exif:GPSAltitude>

As you can see Bridge uses it's own format for GPSLatitude and GPSLongitude

It also requires GPSAltitudeRef 0 for above sea level 1 for below sea level

The GPSAltitude needs to be in the above format.

I could possibly code the above changes if you could let me know what the GPSAltitute is I.E feet/meters etc.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 10, 2019 Feb 10, 2019

Copy link to clipboard

Copied

SuperMerlin​​

The altitude will always be in meters.

I am pretty sure that the adobe script will take this format from a CSV file but I'm not 100% sure.

<exif:GPSLatitude>     52.393140

<exif:GPSLongitude>     12.605566

<exif:GPSAltitude>     165.779 m

The format of the actual data above (ie 52.393140) is the format being updated by ExifTool.  So I am not sure if Bridge will accept that data and then "auto convert" it??  I just don't know.

This tag already exists and does not need to be added in.  It in almost all cases be 0

<exif:GPSAltitudeRef>     0

The data in my CSV file is in Decimal Degrees xx.xxxxxxxx.  I found a script that a guy wrote for converting it from Decimal Degrees to the Adobe format for Bridge.

Re: Entering GPS data into Bridge in the correct format

Would that script be helpful?

I am trying to come up with 2 methods that this can be used to makes these updates for folks doing drone mapping (one using ExifTool and one using Bridge).  The ExifTool option is now working very nicely.  The Bridge script you wrote was working nicely but then I found out that I must update the GPS data in the EXIF block as well as adding it to the XMP-dji-drone block.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guide ,
Feb 07, 2019 Feb 07, 2019

Copy link to clipboard

Copied

Oh dear, its my fault! I was rushing to create the script. The problem I suspect is that the file names have a space in them and I am removing all spaces. I will amend the code and re-post it later on today.

Sorry about this!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Apr 13, 2016 Apr 13, 2016

Copy link to clipboard

Copied

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 07, 2018 Nov 07, 2018

Copy link to clipboard

Copied

Hi!

Can we use the exact same script for EPS files? I noticed that in Bridge CC 2019 when we click a EPS we can edit it's metadata (title, description, keywords) directly in Bridge.

Knowing this, would a script be possible to read a CSV and import those fields into a EPS instead of a JPG?

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Nov 07, 2018 Nov 07, 2018

Copy link to clipboard

Copied

Hi!

Can we use the exact same script for EPS files? I noticed that in Bridge CC 2019 when we click a EPS we can edit it's metadata (title, description, keywords) directly in Bridge.

Knowing this, would a script be possible to read a CSV and import those fields into a EPS instead of a JP

Yes, the DIY Metadata script works with a Photoshop EPS file (I have not tested with Illustrator EPS):

DIY.png

And it also works for the VRA tool as well:

VRA.png

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 07, 2018 Nov 07, 2018

Copy link to clipboard

Copied

Ok, in the past I tried DIY Metadata script and I didn't seem to work with illustrator EPS (that is the kind of EPS I am trying to work on). I will give it another try along with VRA panel and will post here if it works with Illustrator EPS. Thanks a lot for the suggestion.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Nov 07, 2018 Nov 07, 2018

Copy link to clipboard

Copied

Both DIY and VRA work with Illustrator EPS! I Tested Illustrator CC2018 EPS and legacy Illustrator 3 EPS formats (both extremes available to me).

As both import tools have very specific requirements for source data, you have to be very careful when setting up the spreadsheet files.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 08, 2018 Nov 08, 2018

Copy link to clipboard

Copied

Wow thanks so much Stephen for testing it out. Very happy that there is a solution to Illustrator EPS, Will be great with my workflow!

Thanks so much again!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Nov 14, 2018 Nov 14, 2018

Copy link to clipboard

Copied

Stephen, is this script created for the Department of Defense? these looks like the fields one need to fill for their requirements...

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Community Professional ,
Nov 14, 2018 Nov 14, 2018

Copy link to clipboard

Copied

It was created by/for the Visual Resources Association:

Visual Resources Association

Looking at the list of affiliated orgs, there may be some cross-over of terms:

Affiliated and Related Organizations | Visual Resources Association

The VRA Import-Export script is hosted here:

Metadata Deluxe / VRA Panel Export-Import Tool 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 06, 2019 Feb 06, 2019

Copy link to clipboard

Copied

I just found where Adobe Bridge is FREE for life. 

free-adobe-bridge-cc

 

However, I installed the scripts and it appears there are only certain tags that can be exported and/or imported.  So adding the custom XMP tags that I mentioned above does not seem possible.  I will just wait until one of you guys can provide some expert advice on which direction I should go. 

 

Thanks!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines