• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

extract metadata

New Here ,
May 20, 2015 May 20, 2015

Copy link to clipboard

Copied

Hi All,

I want to extract metadata from bridge. I have 10000 images and need to get the file size, resolution, width n height and color mode/space.

I have lots of scripts by downloading from net. But those weren't providing the resolution and color mode specifically. But these both are important for me.

Thanks for your help!

Purushoth

TOPICS
Scripting

Views

1.7K

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

Enthusiast , Jun 25, 2015 Jun 25, 2015

There is a script "Extract Metadata" in the Bridge section at http://www.ps-bridge-scripts.talktalk.net/ that will allow you to do this.

Votes

Translate

Translate
Enthusiast ,
May 21, 2015 May 21, 2015

Copy link to clipboard

Copied

This will create a csv file on the desktop.

Copy and paste the script into ExtendScript Toolkit or a PLAIN TEXT editor.

Then save it out as filename.jsx

The correct folder to save the script can be found by opening Bridge, going to the preferences - Startup Scripts and clicking on the "Reveal my startup scripts" button.

Once saved close and re-start Bridge and accept the new script.

To use, selected the folder you want then Tools - Extract Metadata

#target bridge  

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

extractMetadata = MenuElement.create("command", "Extract Metadata", "at the end of Tools");

}

extractMetadata.onSelect = function () {

var CSV = new File (Folder.desktop + "/" + decodeURI(Folder(app.document.presentationPath).name) + time() +".csv");

CSV.open('w');

app.document.deselectAll();

CSV.writeln("File Name,File Size,Resolution,Width,Height,Colour Mode");

//add or remove file types to process.

var sels = app.document.getSelection("jpg,tif,gif,psd,pcx,png,eps,crw,cr2,tiff,raw,rw2,dng,nef,orf,erf,mos,dcr,raf,srf,pef,x3f");

for(var a in sels){

var thumb = sels;

if(thumb.type !='file') continue;

app.synchronousMode = true;

thumb.core.thumbnail.thumbnail;

var ColourMode = thumb.core.quickMetadata.colorMode;

var Height = thumb.core.quickMetadata.height;

var Width = thumb.core.quickMetadata.width;

var Resolution = thumb.core.quickMetadata.xResolution;

if(Resolution == 0) Resolution = 72;

if(ColourMode == undefined) ColourMode = 99;

switch (Number(ColourMode)){

    case 0: ColourMode = 'Bitmap'; break;

    case 1: ColourMode = 'Grayscale'; break;

    case 2: ColourMode = 'Indexed Color'; break;

    case 3: ColourMode = 'RGB'; break;

    case 4: ColourMode = 'CMYK'; break;

    case 7: ColourMode = 'Multichannel'; break;

    case 8: ColourMode = 'Duotone'; break;

    case 9: ColourMode = 'Lab'; break;

    default : ColourMode = 'Untagged'; break;

        }

var Line = decodeURI(thumb.spec.name) + ","+ thumb.spec.length + "," + Resolution + "," + Width + "," + Height + "," + ColourMode;

CSV.writeln(Line);

    }

CSV.close();

alert(decodeURI(CSV.name) + " has been saved to the desktop");

function time(){

var date = new Date();

    var d  = date.getDate();

    var day = (d < 10) ? '0' + d : d;

    var m = date.getMonth() + 1;

    var month = (m < 10) ? '0' + m : m;

    var yy = date.getYear();

    var year = (yy < 1000) ? yy + 1900 : yy;

    var digital = new Date();

    var hours = digital.getHours();

    var minutes = digital.getMinutes();

    var seconds = digital.getSeconds();

    var amOrPm = "AM";

    if (hours > 11) amOrPm = "PM";

    if (hours > 12) hours = hours - 12;

    if (hours == 0) hours = 12;

    if (minutes <= 9) minutes = "0" + minutes;

    if (seconds <= 9) seconds = "0" + seconds;

    todaysDate = "-" + hours + "_" + minutes + "_" + seconds + amOrPm;

    return todaysDate.toString();

};

};

Votes

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
Contributor ,
Jun 25, 2015 Jun 25, 2015

Copy link to clipboard

Copied

HI, I need to only extract the pixel dimensions metadata from a folder of images into a .csv file. I wondered if you could tell me if your script could be modified to just include the pixel dimensions?

Thanks in advance.

Votes

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
Enthusiast ,
Jun 25, 2015 Jun 25, 2015

Copy link to clipboard

Copied

There is a script "Extract Metadata" in the Bridge section at http://www.ps-bridge-scripts.talktalk.net/ that will allow you to do this.

Votes

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
Contributor ,
Jun 25, 2015 Jun 25, 2015

Copy link to clipboard

Copied

Thanks very much for the link. I had a look and saw that there was a script called "Copy Metadata" but not "Extract Metadata". I was looking under the Bridge category so I'm not sure why I'm not seeing it. Do you know if it was removed?

Votes

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
Contributor ,
Jun 25, 2015 Jun 25, 2015

Copy link to clipboard

Copied

Sorry I just found it. I wasn't aware that I was supposed to click the down arrow to reveal more of the scripts. Thanks again for your help.

Votes

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
New Here ,
Sep 30, 2015 Sep 30, 2015

Copy link to clipboard

Copied

LATEST

I was wondering if anyone knows of any resources that will allow me to extract keyword metadata but keep it organized according to my keyword hierarchy. With my parent keywords as the column headings in my excel spreadsheet.

Votes

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