10 Replies Latest reply: Jan 10, 2013 6:00 PM by JWJB RSS

    Is there a way to extract an image file metadata?

    TCarp Community Member

      I know this isn't specific to PS but hope there's an answer here.

       

      I'm transcribing some of the metadata from image files to build a simple catalog.  Included are things like dimensions, resolution, and photo date.  Is there a way to extract this data other than manually?

       

      Thanks

       

      Tom

        • 1. Re: Is there a way to extract an image file metadata?
          RWSP Community Member

          Possibly in Bridge using a script.  You might inquire in the Bridge forum.

          • 2. Re: Is there a way to extract an image file metadata?
            JJMack Community Member

            A Photoshop script can with ease.

            // This script is supplied as is. It is provided as freeware.
            // The author accepts no liability for any problems arising from its use.
            /*
            <javascriptresource>
            <about>$$$/JavaScripts/metadata/About=JJMack's pdf metadata.^r^rCopyright 2009 Mouseprints.^r^rJJMack's Script.^rNOTE:Copy Document metadata to a text file in same folder with same filename!</about>
            </javascriptresource>
            */
            //<category>JJMack's Script</category>
            // enable double-clicking from Mac Finder or Windows Explorer
            #target photoshop // this command only works in Photoshop CS2 and higher
            
            
            // bring application forward for double-click events
            app.bringToFront();
            
            
            // ensure at least one document open
            if (!documents.length) {
                      alert('There are no documents open.', 'No Document');
            }
            
            
            // if at least one document exists, then proceed
            else {
                      main();
            }
            
            
            ///////////////////////////////////////////////////////////////////////////////
            // main - main function
            ///////////////////////////////////////////////////////////////////////////////
            function main() {
                      try {
                              // remember users Ruler avd Type Units and set ours
                                var strtRulerUnits = app.preferences.rulerUnits; 
                                var strtTypeUnits = app.preferences.typeUnits; 
                                app.preferences.rulerUnits = Units.PIXELS;
                                 app.preferences.typeUnits = TypeUnits.PIXELS; 
            
            
                                xml = app.activeDocument.xmpMetadata.rawData;
                            //writeTXT(xml);
            
            
                                //alert ("length of metadata = " + xml.length);
                                //alert (xml);
                                xmpdatastart = xml.indexOf("<x:xmpmeta");
                                xmpdataend = xml.indexOf("</x:xmpmeta>") +  "</x:xmpmeta>".length;
                                //alert ("xmpdatastart = " + xmpdatastart + " xmpdatalength = " + xmpdatalength );
                                xmpdata = xml.substr(xmpdatastart, xmpdataend );
                                writeTXT(xmpdata);
                                var mySourceFilePath = activeDocument.fullName.path + "/";
                                alert("Operation Complete! Metadata exported to: " + mySourceFilePath.toString().match(/([^\.]+)/)[1] + app.activeDocument.name.match(/([^\.]+)/)[1] + ".txt");
            
            
                                // break up into segments and make text layers
                                n = 1
                                for (var i = 0; i < xmpdataend - xmpdatastart; ){
                                          datalength = xmpdata.indexOf("</rdf:Description>") +  "</rdf:Description>".length;
                                          //alert ("datalength = " + datalength );
                                          if (datalength == 17) { datalength = 34;}
                                          data = xmpdata.substr(0, datalength);
                                          endofdata = xmpdata.indexOf("</x:xmpmeta>") +  "</x:xmpmeta>".length;
                                          xmpdata = xmpdata.substr(datalength, endofdata);
                                          i = i + datalength;
                                          // addTextLayer(data, n);
                                            alert (data);
                                          n = n + 1;
                                          }
            
            
            
            
                                app.preferences.rulerUnits = strtRulerUnits; 
                                app.preferences.typeUnits = strtTypeUnits; 
                      }
            
            
                      // display error message if something goes wrong
                      catch(e) { alert(e + ': on line ' + e.line, 'Script Error', true); }
            }
            
            
            
            
            function addTextLayer(textdata, n) {
            
            
                    /* textX and TextY positions text placement 0 and 0 Top Left corner of image in pixels          */
                      var textX = 0; 
                      var textY = 0; 
                      /* Internal Photoshop Text font name                                                                      */ 
                    var fontName = "ArialMT";
                      var fontName = "TimesNewRomanPSMT";
                      //var fontName = "Tahoma";
                      var fontSize = 6;
                      /* Text Color                                                                                                    */
                      textColor = new SolidColor; 
                      textColor.rgb.red = 255;
                      textColor.rgb.green = 255;
                      textColor.rgb.blue = 255;
            
            
                      text_layer = app.activeDocument.artLayers.add();                                        // Add a Layer
                      text_layer.kind = LayerKind.TEXT;                                                            // Make Layer a Text Layer
                      text_layer.textItem.color = textColor;                                                            // set text layer color
                      text_layer.blendMode = BlendMode.NORMAL                                                            // blend mode
                      text_layer.textItem.font = fontName;                                                            // set text font
                      text_layer.textItem.size = fontSize;                                                            // set text font Size
                      text_layer.textItem.position = Array(textX, (textY + (fontSize * 3)) );                    // set text layers position in and down for fontsize 
                      //text_layer.textItem.position = Array(textX, (textY + (fontSize * 3 * n)) );          // set text layers position in and down for fontsize 
                      text_layer.textItem.contents = textdata;                                                  // set text layers text 
            
            
            }
            
            
            
            
            // Write TXT file
                function writeTXT(data) {
                      // Use this to export metadata file to same directory where this file is located
                      var mySourceFilePath = activeDocument.fullName.path + "/";
                      // create a reference to a file for output
                      var TXTFile = new File(mySourceFilePath.toString().match(/([^\.]+)/)[1] + app.activeDocument.name.match(/([^\.]+)/)[1] + ".txt");
                    try {
                        if(TXTFile.exists) {
                            TXTFile.open ("e");
                            TXTFile.seek (0,2);      // Move to EOF
                        } else {
                        TXTFile.open ("w");          // Add unicode marker if we change to XML file format for this log file
                    }
                    TXTFile.encoding = "UTF8";       // set UTF8
                    TXTFile.write(data);
                    TXTFile.close();
                    } catch (e) {
                        alert(e);
                    } finally {
                    }
                    return;
                }
            
            

             

            Outputs an XML file that looks like this:

             

            <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.3-c011 66.145661, 2012/02/06-14:56:27        ">
               <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                  <rdf:Description rdf:about=""
                        xmlns:dc="http://purl.org/dc/elements/1.1/">
                     <dc:format>image/tiff</dc:format>
                     <dc:creator>
                        <rdf:Seq>
                           <rdf:li>Pam McAssey</rdf:li>
                        </rdf:Seq>
                     </dc:creator>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:aux="http://ns.adobe.com/exif/1.0/aux/">
                     <aux:SerialNumber>720600641</aux:SerialNumber>
                     <aux:LensInfo>24/1 70/1 0/0 0/0</aux:LensInfo>
                     <aux:Lens>EF24-70mm f/2.8L USM</aux:Lens>
                     <aux:LensID>230</aux:LensID>
                     <aux:ImageNumber>0</aux:ImageNumber>
                     <aux:ApproximateFocusDistance>122/100</aux:ApproximateFocusDistance>
                     <aux:FlashCompensation>0/1</aux:FlashCompensation>
                     <aux:Firmware>1.0.6</aux:Firmware>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:xmp="http://ns.adobe.com/xap/1.0/">
                     <xmp:ModifyDate>2012-12-19T11:23:49-05:00</xmp:ModifyDate>
                     <xmp:CreateDate>2012-12-16T17:11:53</xmp:CreateDate>
                     <xmp:Rating>0</xmp:Rating>
                     <xmp:MetadataDate>2012-12-19T11:23:49-05:00</xmp:MetadataDate>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
                     <photoshop:DateCreated>2012-12-16T17:11:53</photoshop:DateCreated>
                     <photoshop:ColorMode>3</photoshop:ColorMode>
                     <photoshop:ICCProfile>ProPhoto RGB</photoshop:ICCProfile>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
                        xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
                        xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#">
                     <xmpMM:DocumentID>xmp.did:b13179a4-0983-a649-a532-0d90ea6feea5</xmpMM:DocumentID>
                     <xmpMM:OriginalDocumentID>E634097DE11761C5824C1873DDBDEDDD</xmpMM:OriginalDocumentID>
                     <xmpMM:InstanceID>xmp.iid:b13179a4-0983-a649-a532-0d90ea6feea5</xmpMM:InstanceID>
                     <xmpMM:History>
                        <rdf:Seq>
                           <rdf:li rdf:parseType="Resource">
                              <stEvt:action>saved</stEvt:action>
                              <stEvt:instanceID>xmp.iid:9d0e25ce-f732-d74a-9631-086fc6151324</stEvt:instanceID>
                              <stEvt:when>2012-12-16T16:11:44-05:00</stEvt:when>
                              <stEvt:softwareAgent>Adobe Photoshop Camera Raw 7.3 (Windows)</stEvt:softwareAgent>
                              <stEvt:changed>/metadata</stEvt:changed>
                           </rdf:li>
                           <rdf:li rdf:parseType="Resource">
                              <stEvt:action>saved</stEvt:action>
                              <stEvt:instanceID>xmp.iid:0816d1f7-2bb5-e344-806a-6da92a4c8540</stEvt:instanceID>
                              <stEvt:when>2012-12-16T16:13:18-05:00</stEvt:when>
                              <stEvt:softwareAgent>Adobe Photoshop Camera Raw 7.3 (Windows)</stEvt:softwareAgent>
                              <stEvt:changed>/metadata</stEvt:changed>
                           </rdf:li>
                           <rdf:li rdf:parseType="Resource">
                              <stEvt:action>derived</stEvt:action>
                              <stEvt:parameters>converted from image/x-canon-cr2 to image/tiff</stEvt:parameters>
                           </rdf:li>
                           <rdf:li rdf:parseType="Resource">
                              <stEvt:action>saved</stEvt:action>
                              <stEvt:instanceID>xmp.iid:b13179a4-0983-a649-a532-0d90ea6feea5</stEvt:instanceID>
                              <stEvt:when>2012-12-19T11:23:49-05:00</stEvt:when>
                              <stEvt:softwareAgent>Adobe Photoshop Camera Raw 7.3 (Windows)</stEvt:softwareAgent>
                              <stEvt:changed>/</stEvt:changed>
                           </rdf:li>
                        </rdf:Seq>
                     </xmpMM:History>
                     <xmpMM:DerivedFrom rdf:parseType="Resource">
                        <stRef:instanceID>xmp.iid:0816d1f7-2bb5-e344-806a-6da92a4c8540</stRef:instanceID>
                        <stRef:documentID>E634097DE11761C5824C1873DDBDEDDD</stRef:documentID>
                        <stRef:originalDocumentID>E634097DE11761C5824C1873DDBDEDDD</stRef:originalDocumentID>
                     </xmpMM:DerivedFrom>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/">
                     <crs:RawFileName>_S1H4635.CR2</crs:RawFileName>
                     <crs:Version>7.3</crs:Version>
                     <crs:ProcessVersion>6.7</crs:ProcessVersion>
                     <crs:WhiteBalance>As Shot</crs:WhiteBalance>
                     <crs:Temperature>5950</crs:Temperature>
                     <crs:Tint>+46</crs:Tint>
                     <crs:Saturation>0</crs:Saturation>
                     <crs:Sharpness>25</crs:Sharpness>
                     <crs:LuminanceSmoothing>0</crs:LuminanceSmoothing>
                     <crs:ColorNoiseReduction>25</crs:ColorNoiseReduction>
                     <crs:VignetteAmount>0</crs:VignetteAmount>
                     <crs:ShadowTint>0</crs:ShadowTint>
                     <crs:RedHue>0</crs:RedHue>
                     <crs:RedSaturation>0</crs:RedSaturation>
                     <crs:GreenHue>0</crs:GreenHue>
                     <crs:GreenSaturation>0</crs:GreenSaturation>
                     <crs:BlueHue>0</crs:BlueHue>
                     <crs:BlueSaturation>0</crs:BlueSaturation>
                     <crs:Vibrance>0</crs:Vibrance>
                     <crs:HueAdjustmentRed>0</crs:HueAdjustmentRed>
                     <crs:HueAdjustmentOrange>0</crs:HueAdjustmentOrange>
                     <crs:HueAdjustmentYellow>0</crs:HueAdjustmentYellow>
                     <crs:HueAdjustmentGreen>0</crs:HueAdjustmentGreen>
                     <crs:HueAdjustmentAqua>0</crs:HueAdjustmentAqua>
                     <crs:HueAdjustmentBlue>0</crs:HueAdjustmentBlue>
                     <crs:HueAdjustmentPurple>0</crs:HueAdjustmentPurple>
                     <crs:HueAdjustmentMagenta>0</crs:HueAdjustmentMagenta>
                     <crs:SaturationAdjustmentRed>0</crs:SaturationAdjustmentRed>
                     <crs:SaturationAdjustmentOrange>0</crs:SaturationAdjustmentOrange>
                     <crs:SaturationAdjustmentYellow>0</crs:SaturationAdjustmentYellow>
                     <crs:SaturationAdjustmentGreen>0</crs:SaturationAdjustmentGreen>
                     <crs:SaturationAdjustmentAqua>0</crs:SaturationAdjustmentAqua>
                     <crs:SaturationAdjustmentBlue>0</crs:SaturationAdjustmentBlue>
                     <crs:SaturationAdjustmentPurple>0</crs:SaturationAdjustmentPurple>
                     <crs:SaturationAdjustmentMagenta>0</crs:SaturationAdjustmentMagenta>
                     <crs:LuminanceAdjustmentRed>0</crs:LuminanceAdjustmentRed>
                     <crs:LuminanceAdjustmentOrange>0</crs:LuminanceAdjustmentOrange>
                     <crs:LuminanceAdjustmentYellow>0</crs:LuminanceAdjustmentYellow>
                     <crs:LuminanceAdjustmentGreen>0</crs:LuminanceAdjustmentGreen>
                     <crs:LuminanceAdjustmentAqua>0</crs:LuminanceAdjustmentAqua>
                     <crs:LuminanceAdjustmentBlue>0</crs:LuminanceAdjustmentBlue>
                     <crs:LuminanceAdjustmentPurple>0</crs:LuminanceAdjustmentPurple>
                     <crs:LuminanceAdjustmentMagenta>0</crs:LuminanceAdjustmentMagenta>
                     <crs:SplitToningShadowHue>0</crs:SplitToningShadowHue>
                     <crs:SplitToningShadowSaturation>0</crs:SplitToningShadowSaturation>
                     <crs:SplitToningHighlightHue>0</crs:SplitToningHighlightHue>
                     <crs:SplitToningHighlightSaturation>0</crs:SplitToningHighlightSaturation>
                     <crs:SplitToningBalance>0</crs:SplitToningBalance>
                     <crs:ParametricShadows>0</crs:ParametricShadows>
                     <crs:ParametricDarks>0</crs:ParametricDarks>
                     <crs:ParametricLights>0</crs:ParametricLights>
                     <crs:ParametricHighlights>0</crs:ParametricHighlights>
                     <crs:ParametricShadowSplit>25</crs:ParametricShadowSplit>
                     <crs:ParametricMidtoneSplit>50</crs:ParametricMidtoneSplit>
                     <crs:ParametricHighlightSplit>75</crs:ParametricHighlightSplit>
                     <crs:SharpenRadius>+1.0</crs:SharpenRadius>
                     <crs:SharpenDetail>25</crs:SharpenDetail>
                     <crs:SharpenEdgeMasking>0</crs:SharpenEdgeMasking>
                     <crs:PostCropVignetteAmount>0</crs:PostCropVignetteAmount>
                     <crs:GrainAmount>0</crs:GrainAmount>
                     <crs:ColorNoiseReductionDetail>50</crs:ColorNoiseReductionDetail>
                     <crs:LensProfileEnable>0</crs:LensProfileEnable>
                     <crs:LensManualDistortionAmount>0</crs:LensManualDistortionAmount>
                     <crs:PerspectiveVertical>0</crs:PerspectiveVertical>
                     <crs:PerspectiveHorizontal>0</crs:PerspectiveHorizontal>
                     <crs:PerspectiveRotate>0.0</crs:PerspectiveRotate>
                     <crs:PerspectiveScale>100</crs:PerspectiveScale>
                     <crs:AutoLateralCA>0</crs:AutoLateralCA>
                     <crs:Exposure2012>-1.30</crs:Exposure2012>
                     <crs:Contrast2012>-25</crs:Contrast2012>
                     <crs:Highlights2012>0</crs:Highlights2012>
                     <crs:Shadows2012>0</crs:Shadows2012>
                     <crs:Whites2012>+2</crs:Whites2012>
                     <crs:Blacks2012>-9</crs:Blacks2012>
                     <crs:Clarity2012>0</crs:Clarity2012>
                     <crs:DefringePurpleAmount>0</crs:DefringePurpleAmount>
                     <crs:DefringePurpleHueLo>30</crs:DefringePurpleHueLo>
                     <crs:DefringePurpleHueHi>70</crs:DefringePurpleHueHi>
                     <crs:DefringeGreenAmount>0</crs:DefringeGreenAmount>
                     <crs:DefringeGreenHueLo>40</crs:DefringeGreenHueLo>
                     <crs:DefringeGreenHueHi>60</crs:DefringeGreenHueHi>
                     <crs:ConvertToGrayscale>False</crs:ConvertToGrayscale>
                     <crs:ToneCurveName2012>Linear</crs:ToneCurveName2012>
                     <crs:ToneCurvePV2012>
                        <rdf:Seq>
                           <rdf:li>0, 0</rdf:li>
                           <rdf:li>255, 255</rdf:li>
                        </rdf:Seq>
                     </crs:ToneCurvePV2012>
                     <crs:ToneCurvePV2012Red>
                        <rdf:Seq>
                           <rdf:li>0, 0</rdf:li>
                           <rdf:li>255, 255</rdf:li>
                        </rdf:Seq>
                     </crs:ToneCurvePV2012Red>
                     <crs:ToneCurvePV2012Green>
                        <rdf:Seq>
                           <rdf:li>0, 0</rdf:li>
                           <rdf:li>255, 255</rdf:li>
                        </rdf:Seq>
                     </crs:ToneCurvePV2012Green>
                     <crs:ToneCurvePV2012Blue>
                        <rdf:Seq>
                           <rdf:li>0, 0</rdf:li>
                           <rdf:li>255, 255</rdf:li>
                        </rdf:Seq>
                     </crs:ToneCurvePV2012Blue>
                     <crs:CameraProfile>Adobe Standard</crs:CameraProfile>
                     <crs:CameraProfileDigest>3CE8523BCEA625D0F0ABABADE3BCC281</crs:CameraProfileDigest>
                     <crs:LensProfileSetup>LensDefaults</crs:LensProfileSetup>
                     <crs:HasSettings>True</crs:HasSettings>
                     <crs:HasCrop>False</crs:HasCrop>
                     <crs:AlreadyApplied>True</crs:AlreadyApplied>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:tiff="http://ns.adobe.com/tiff/1.0/">
                     <tiff:XResolution>240/1</tiff:XResolution>
                     <tiff:YResolution>240/1</tiff:YResolution>
                     <tiff:ResolutionUnit>2</tiff:ResolutionUnit>
                     <tiff:Make>Canon</tiff:Make>
                     <tiff:Model>Canon EOS-1D Mark IV</tiff:Model>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:exif="http://ns.adobe.com/exif/1.0/">
                     <exif:ExifVersion>0221</exif:ExifVersion>
                     <exif:PixelXDimension>4896</exif:PixelXDimension>
                     <exif:PixelYDimension>3264</exif:PixelYDimension>
                     <exif:DateTimeOriginal>2012-12-16T17:11:53</exif:DateTimeOriginal>
                     <exif:ExposureTime>1/30</exif:ExposureTime>
                     <exif:FNumber>28/10</exif:FNumber>
                     <exif:ExposureProgram>2</exif:ExposureProgram>
                     <exif:ISOSpeedRatings>
                        <rdf:Seq>
                           <rdf:li>3200</rdf:li>
                        </rdf:Seq>
                     </exif:ISOSpeedRatings>
                     <exif:ShutterSpeedValue>4906891/1000000</exif:ShutterSpeedValue>
                     <exif:ApertureValue>2970854/1000000</exif:ApertureValue>
                     <exif:ExposureBiasValue>0/1</exif:ExposureBiasValue>
                     <exif:MaxApertureValue>3/1</exif:MaxApertureValue>
                     <exif:MeteringMode>5</exif:MeteringMode>
                     <exif:Flash rdf:parseType="Resource">
                        <exif:Fired>False</exif:Fired>
                        <exif:Return>0</exif:Return>
                        <exif:Mode>2</exif:Mode>
                        <exif:Function>False</exif:Function>
                        <exif:RedEyeMode>False</exif:RedEyeMode>
                     </exif:Flash>
                     <exif:FocalLength>64/1</exif:FocalLength>
                     <exif:FocalPlaneXResolution>4896000/1290</exif:FocalPlaneXResolution>
                     <exif:FocalPlaneYResolution>3264000/836</exif:FocalPlaneYResolution>
                     <exif:FocalPlaneResolutionUnit>2</exif:FocalPlaneResolutionUnit>
                     <exif:CustomRendered>0</exif:CustomRendered>
                     <exif:ExposureMode>0</exif:ExposureMode>
                     <exif:WhiteBalance>0</exif:WhiteBalance>
                     <exif:SceneCaptureType>0</exif:SceneCaptureType>
                     <exif:SubSecTime>00</exif:SubSecTime>
                     <exif:SubSecTimeOriginal>00</exif:SubSecTimeOriginal>
                     <exif:SubSecTimeDigitized>00</exif:SubSecTimeDigitized>
                     <exif:SerialNumber>720600641</exif:SerialNumber>
                     <exif:LensInfo>
                        <rdf:Seq>
                           <rdf:li>24/1</rdf:li>
                        </rdf:Seq>
                     </exif:LensInfo>
                     <exif:Lens>EF24-70mm f/2.8L USM</exif:Lens>
                  </rdf:Description>
               </rdf:RDF>
            </x:xmpmeta>
                                                               <x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.3-c011 66.145661, 2012/02/06-14:56:27        ">
               <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
                  <rdf:Description rdf:about=""
                        xmlns:dc="http://purl.org/dc/elements/1.1/">
                     <dc:format>image/tiff</dc:format>
                     <dc:creator>
                        <rdf:Seq>
                           <rdf:li>Pam McAssey</rdf:li>
                        </rdf:Seq>
                     </dc:creator>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:aux="http://ns.adobe.com/exif/1.0/aux/">
                     <aux:SerialNumber>720600641</aux:SerialNumber>
                     <aux:LensInfo>24/1 70/1 0/0 0/0</aux:LensInfo>
                     <aux:Lens>EF24-70mm f/2.8L USM</aux:Lens>
                     <aux:LensID>230</aux:LensID>
                     <aux:ImageNumber>0</aux:ImageNumber>
                     <aux:ApproximateFocusDistance>122/100</aux:ApproximateFocusDistance>
                     <aux:FlashCompensation>0/1</aux:FlashCompensation>
                     <aux:Firmware>1.0.6</aux:Firmware>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:xmp="http://ns.adobe.com/xap/1.0/">
                     <xmp:ModifyDate>2012-12-19T11:23:49-05:00</xmp:ModifyDate>
                     <xmp:CreateDate>2012-12-16T17:11:53</xmp:CreateDate>
                     <xmp:Rating>0</xmp:Rating>
                     <xmp:MetadataDate>2012-12-19T11:23:49-05:00</xmp:MetadataDate>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:photoshop="http://ns.adobe.com/photoshop/1.0/">
                     <photoshop:DateCreated>2012-12-16T17:11:53</photoshop:DateCreated>
                     <photoshop:ColorMode>3</photoshop:ColorMode>
                     <photoshop:ICCProfile>ProPhoto RGB</photoshop:ICCProfile>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
                        xmlns:stEvt="http://ns.adobe.com/xap/1.0/sType/ResourceEvent#"
                        xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#">
                     <xmpMM:DocumentID>xmp.did:b13179a4-0983-a649-a532-0d90ea6feea5</xmpMM:DocumentID>
                     <xmpMM:OriginalDocumentID>E634097DE11761C5824C1873DDBDEDDD</xmpMM:OriginalDocumentID>
                     <xmpMM:InstanceID>xmp.iid:b13179a4-0983-a649-a532-0d90ea6feea5</xmpMM:InstanceID>
                     <xmpMM:History>
                        <rdf:Seq>
                           <rdf:li rdf:parseType="Resource">
                              <stEvt:action>saved</stEvt:action>
                              <stEvt:instanceID>xmp.iid:9d0e25ce-f732-d74a-9631-086fc6151324</stEvt:instanceID>
                              <stEvt:when>2012-12-16T16:11:44-05:00</stEvt:when>
                              <stEvt:softwareAgent>Adobe Photoshop Camera Raw 7.3 (Windows)</stEvt:softwareAgent>
                              <stEvt:changed>/metadata</stEvt:changed>
                           </rdf:li>
                           <rdf:li rdf:parseType="Resource">
                              <stEvt:action>saved</stEvt:action>
                              <stEvt:instanceID>xmp.iid:0816d1f7-2bb5-e344-806a-6da92a4c8540</stEvt:instanceID>
                              <stEvt:when>2012-12-16T16:13:18-05:00</stEvt:when>
                              <stEvt:softwareAgent>Adobe Photoshop Camera Raw 7.3 (Windows)</stEvt:softwareAgent>
                              <stEvt:changed>/metadata</stEvt:changed>
                           </rdf:li>
                           <rdf:li rdf:parseType="Resource">
                              <stEvt:action>derived</stEvt:action>
                              <stEvt:parameters>converted from image/x-canon-cr2 to image/tiff</stEvt:parameters>
                           </rdf:li>
                           <rdf:li rdf:parseType="Resource">
                              <stEvt:action>saved</stEvt:action>
                              <stEvt:instanceID>xmp.iid:b13179a4-0983-a649-a532-0d90ea6feea5</stEvt:instanceID>
                              <stEvt:when>2012-12-19T11:23:49-05:00</stEvt:when>
                              <stEvt:softwareAgent>Adobe Photoshop Camera Raw 7.3 (Windows)</stEvt:softwareAgent>
                              <stEvt:changed>/</stEvt:changed>
                           </rdf:li>
                        </rdf:Seq>
                     </xmpMM:History>
                     <xmpMM:DerivedFrom rdf:parseType="Resource">
                        <stRef:instanceID>xmp.iid:0816d1f7-2bb5-e344-806a-6da92a4c8540</stRef:instanceID>
                        <stRef:documentID>E634097DE11761C5824C1873DDBDEDDD</stRef:documentID>
                        <stRef:originalDocumentID>E634097DE11761C5824C1873DDBDEDDD</stRef:originalDocumentID>
                     </xmpMM:DerivedFrom>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/">
                     <crs:RawFileName>_S1H4635.CR2</crs:RawFileName>
                     <crs:Version>7.3</crs:Version>
                     <crs:ProcessVersion>6.7</crs:ProcessVersion>
                     <crs:WhiteBalance>As Shot</crs:WhiteBalance>
                     <crs:Temperature>5950</crs:Temperature>
                     <crs:Tint>+46</crs:Tint>
                     <crs:Saturation>0</crs:Saturation>
                     <crs:Sharpness>25</crs:Sharpness>
                     <crs:LuminanceSmoothing>0</crs:LuminanceSmoothing>
                     <crs:ColorNoiseReduction>25</crs:ColorNoiseReduction>
                     <crs:VignetteAmount>0</crs:VignetteAmount>
                     <crs:ShadowTint>0</crs:ShadowTint>
                     <crs:RedHue>0</crs:RedHue>
                     <crs:RedSaturation>0</crs:RedSaturation>
                     <crs:GreenHue>0</crs:GreenHue>
                     <crs:GreenSaturation>0</crs:GreenSaturation>
                     <crs:BlueHue>0</crs:BlueHue>
                     <crs:BlueSaturation>0</crs:BlueSaturation>
                     <crs:Vibrance>0</crs:Vibrance>
                     <crs:HueAdjustmentRed>0</crs:HueAdjustmentRed>
                     <crs:HueAdjustmentOrange>0</crs:HueAdjustmentOrange>
                     <crs:HueAdjustmentYellow>0</crs:HueAdjustmentYellow>
                     <crs:HueAdjustmentGreen>0</crs:HueAdjustmentGreen>
                     <crs:HueAdjustmentAqua>0</crs:HueAdjustmentAqua>
                     <crs:HueAdjustmentBlue>0</crs:HueAdjustmentBlue>
                     <crs:HueAdjustmentPurple>0</crs:HueAdjustmentPurple>
                     <crs:HueAdjustmentMagenta>0</crs:HueAdjustmentMagenta>
                     <crs:SaturationAdjustmentRed>0</crs:SaturationAdjustmentRed>
                     <crs:SaturationAdjustmentOrange>0</crs:SaturationAdjustmentOrange>
                     <crs:SaturationAdjustmentYellow>0</crs:SaturationAdjustmentYellow>
                     <crs:SaturationAdjustmentGreen>0</crs:SaturationAdjustmentGreen>
                     <crs:SaturationAdjustmentAqua>0</crs:SaturationAdjustmentAqua>
                     <crs:SaturationAdjustmentBlue>0</crs:SaturationAdjustmentBlue>
                     <crs:SaturationAdjustmentPurple>0</crs:SaturationAdjustmentPurple>
                     <crs:SaturationAdjustmentMagenta>0</crs:SaturationAdjustmentMagenta>
                     <crs:LuminanceAdjustmentRed>0</crs:LuminanceAdjustmentRed>
                     <crs:LuminanceAdjustmentOrange>0</crs:LuminanceAdjustmentOrange>
                     <crs:LuminanceAdjustmentYellow>0</crs:LuminanceAdjustmentYellow>
                     <crs:LuminanceAdjustmentGreen>0</crs:LuminanceAdjustmentGreen>
                     <crs:LuminanceAdjustmentAqua>0</crs:LuminanceAdjustmentAqua>
                     <crs:LuminanceAdjustmentBlue>0</crs:LuminanceAdjustmentBlue>
                     <crs:LuminanceAdjustmentPurple>0</crs:LuminanceAdjustmentPurple>
                     <crs:LuminanceAdjustmentMagenta>0</crs:LuminanceAdjustmentMagenta>
                     <crs:SplitToningShadowHue>0</crs:SplitToningShadowHue>
                     <crs:SplitToningShadowSaturation>0</crs:SplitToningShadowSaturation>
                     <crs:SplitToningHighlightHue>0</crs:SplitToningHighlightHue>
                     <crs:SplitToningHighlightSaturation>0</crs:SplitToningHighlightSaturation>
                     <crs:SplitToningBalance>0</crs:SplitToningBalance>
                     <crs:ParametricShadows>0</crs:ParametricShadows>
                     <crs:ParametricDarks>0</crs:ParametricDarks>
                     <crs:ParametricLights>0</crs:ParametricLights>
                     <crs:ParametricHighlights>0</crs:ParametricHighlights>
                     <crs:ParametricShadowSplit>25</crs:ParametricShadowSplit>
                     <crs:ParametricMidtoneSplit>50</crs:ParametricMidtoneSplit>
                     <crs:ParametricHighlightSplit>75</crs:ParametricHighlightSplit>
                     <crs:SharpenRadius>+1.0</crs:SharpenRadius>
                     <crs:SharpenDetail>25</crs:SharpenDetail>
                     <crs:SharpenEdgeMasking>0</crs:SharpenEdgeMasking>
                     <crs:PostCropVignetteAmount>0</crs:PostCropVignetteAmount>
                     <crs:GrainAmount>0</crs:GrainAmount>
                     <crs:ColorNoiseReductionDetail>50</crs:ColorNoiseReductionDetail>
                     <crs:LensProfileEnable>0</crs:LensProfileEnable>
                     <crs:LensManualDistortionAmount>0</crs:LensManualDistortionAmount>
                     <crs:PerspectiveVertical>0</crs:PerspectiveVertical>
                     <crs:PerspectiveHorizontal>0</crs:PerspectiveHorizontal>
                     <crs:PerspectiveRotate>0.0</crs:PerspectiveRotate>
                     <crs:PerspectiveScale>100</crs:PerspectiveScale>
                     <crs:AutoLateralCA>0</crs:AutoLateralCA>
                     <crs:Exposure2012>-1.30</crs:Exposure2012>
                     <crs:Contrast2012>-25</crs:Contrast2012>
                     <crs:Highlights2012>0</crs:Highlights2012>
                     <crs:Shadows2012>0</crs:Shadows2012>
                     <crs:Whites2012>+2</crs:Whites2012>
                     <crs:Blacks2012>-9</crs:Blacks2012>
                     <crs:Clarity2012>0</crs:Clarity2012>
                     <crs:DefringePurpleAmount>0</crs:DefringePurpleAmount>
                     <crs:DefringePurpleHueLo>30</crs:DefringePurpleHueLo>
                     <crs:DefringePurpleHueHi>70</crs:DefringePurpleHueHi>
                     <crs:DefringeGreenAmount>0</crs:DefringeGreenAmount>
                     <crs:DefringeGreenHueLo>40</crs:DefringeGreenHueLo>
                     <crs:DefringeGreenHueHi>60</crs:DefringeGreenHueHi>
                     <crs:ConvertToGrayscale>False</crs:ConvertToGrayscale>
                     <crs:ToneCurveName2012>Linear</crs:ToneCurveName2012>
                     <crs:ToneCurvePV2012>
                        <rdf:Seq>
                           <rdf:li>0, 0</rdf:li>
                           <rdf:li>255, 255</rdf:li>
                        </rdf:Seq>
                     </crs:ToneCurvePV2012>
                     <crs:ToneCurvePV2012Red>
                        <rdf:Seq>
                           <rdf:li>0, 0</rdf:li>
                           <rdf:li>255, 255</rdf:li>
                        </rdf:Seq>
                     </crs:ToneCurvePV2012Red>
                     <crs:ToneCurvePV2012Green>
                        <rdf:Seq>
                           <rdf:li>0, 0</rdf:li>
                           <rdf:li>255, 255</rdf:li>
                        </rdf:Seq>
                     </crs:ToneCurvePV2012Green>
                     <crs:ToneCurvePV2012Blue>
                        <rdf:Seq>
                           <rdf:li>0, 0</rdf:li>
                           <rdf:li>255, 255</rdf:li>
                        </rdf:Seq>
                     </crs:ToneCurvePV2012Blue>
                     <crs:CameraProfile>Adobe Standard</crs:CameraProfile>
                     <crs:CameraProfileDigest>3CE8523BCEA625D0F0ABABADE3BCC281</crs:CameraProfileDigest>
                     <crs:LensProfileSetup>LensDefaults</crs:LensProfileSetup>
                     <crs:HasSettings>True</crs:HasSettings>
                     <crs:HasCrop>False</crs:HasCrop>
                     <crs:AlreadyApplied>True</crs:AlreadyApplied>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:tiff="http://ns.adobe.com/tiff/1.0/">
                     <tiff:XResolution>240/1</tiff:XResolution>
                     <tiff:YResolution>240/1</tiff:YResolution>
                     <tiff:ResolutionUnit>2</tiff:ResolutionUnit>
                     <tiff:Make>Canon</tiff:Make>
                     <tiff:Model>Canon EOS-1D Mark IV</tiff:Model>
                  </rdf:Description>
                  <rdf:Description rdf:about=""
                        xmlns:exif="http://ns.adobe.com/exif/1.0/">
                     <exif:ExifVersion>0221</exif:ExifVersion>
                     <exif:PixelXDimension>4896</exif:PixelXDimension>
                     <exif:PixelYDimension>3264</exif:PixelYDimension>
                     <exif:DateTimeOriginal>2012-12-16T17:11:53</exif:DateTimeOriginal>
                     <exif:ExposureTime>1/30</exif:ExposureTime>
                     <exif:FNumber>28/10</exif:FNumber>
                     <exif:ExposureProgram>2</exif:ExposureProgram>
                     <exif:ISOSpeedRatings>
                        <rdf:Seq>
                           <rdf:li>3200</rdf:li>
                        </rdf:Seq>
                     </exif:ISOSpeedRatings>
                     <exif:ShutterSpeedValue>4906891/1000000</exif:ShutterSpeedValue>
                     <exif:ApertureValue>2970854/1000000</exif:ApertureValue>
                     <exif:ExposureBiasValue>0/1</exif:ExposureBiasValue>
                     <exif:MaxApertureValue>3/1</exif:MaxApertureValue>
                     <exif:MeteringMode>5</exif:MeteringMode>
                     <exif:Flash rdf:parseType="Resource">
                        <exif:Fired>False</exif:Fired>
                        <exif:Return>0</exif:Return>
                        <exif:Mode>2</exif:Mode>
                        <exif:Function>False</exif:Function>
                        <exif:RedEyeMode>False</exif:RedEyeMode>
                     </exif:Flash>
                     <exif:FocalLength>64/1</exif:FocalLength>
                     <exif:FocalPlaneXResolution>4896000/1290</exif:FocalPlaneXResolution>
                     <exif:FocalPlaneYResolution>3264000/836</exif:FocalPlaneYResolution>
                     <exif:FocalPlaneResolutionUnit>2</exif:FocalPlaneResolutionUnit>
                     <exif:CustomRendered>0</exif:CustomRendered>
                     <exif:ExposureMode>0</exif:ExposureMode>
                     <exif:WhiteBalance>0</exif:WhiteBalance>
                     <exif:SceneCaptureType>0</exif:SceneCaptureType>
                     <exif:SubSecTime>00</exif:SubSecTime>
                     <exif:SubSecTimeOriginal>00</exif:SubSecTimeOriginal>
                     <exif:SubSecTimeDigitized>00</exif:SubSecTimeDigitized>
                     <exif:SerialNumber>720600641</exif:SerialNumber>
                     <exif:LensInfo>
                        <rdf:Seq>
                           <rdf:li>24/1</rdf:li>
                        </rdf:Seq>
                     </exif:LensInfo>
                     <exif:Lens>EF24-70mm f/2.8L USM</exif:Lens>
                  </rdf:Description>
               </rdf:RDF>
            </x:xmpmeta>
            
            

             

            Message was edited by: JJMack

            • 3. Re: Is there a way to extract an image file metadata?
              JJMack Community Member

              A script that deals mostly with exif and camera maker data adds a text layer to you document

               

              http://mouseprints.net/old/dpr/Examples/StampEXIF.jpg

              // This script was hacked from one I downloaded from the web JJMack 2008
              
              
              /*  Script to stamp copyright and camera data of shot   */
              
              
              // This script is supplied as is. It is provided as freeware.
              // The author accepts no liability for any problems arising from its use.
              
              
              /*
              <javascriptresource>
              <about>$$$/JavaScripts/StampExif/About=JJMack's Stamp Exif.^r^rCopyright 2009 Mouseprints.^r^rScript utility for action.^rNOTE:Add Text Layer with Fomatted EXIF Data!</about>
              <category>JJMack's Action Utility</category>
              </javascriptresource>
              */
              
              
              // enable double-clicking from Mac Finder or Windows Explorer
              #target photoshop // this command only works in Photoshop CS2 and higher
              
              
              // bring application forward for double-click events
              app.bringToFront();
              
              
              // ensure at least one document open
              if (!documents.length) {
                        alert('There are no documents open.', 'No Document');
              }
              
              
              // if at least one document exists, then proceed
              else {
                        main();
              }
              
              
              ///////////////////////////////////////////////////////////////////////////////
              // main - main function
              ///////////////////////////////////////////////////////////////////////////////
              function main() {
              
              
                        /* Null business owner */
                        var Biz = "";
                        var Owner = "";
              
              
                        /* Variables You can hard code your business owner here */
                        var Biz = "Mouseprints";
                        var Owner = "John J McAssey";
                      /*  sizeFactor influences text size 1 will use largest font 2 will half that font size          */
                        var sizeFactor = 1;
                      /* textX and TextY positions text placement 0 and 0 Top Left corner of image in pixels          */
                        var textX = 0; 
                        var textY = 0; 
                        /* Internal Photoshop Text name                                                                                */ 
                      var fontName = "ArialMT";
                        var fontName = "TimesNewRomanPSMT";
                        var fontName = "Tahoma";
                        /* Text Color                                                                                                    */
                        textColor = new SolidColor; 
                        textColor.rgb.red = 255;
                        textColor.rgb.green = 255;
                        textColor.rgb.blue = 255;
                        /* END Variables You can hard code your business owner here */
              
              
                      // remember users Ruler avd Type Units and set ours
                        var strtRulerUnits = app.preferences.rulerUnits;
                        var strtTypeUnits = app.preferences.typeUnits;
                        app.preferences.rulerUnits = Units.PIXELS;
                         app.preferences.typeUnits = TypeUnits.PIXELS;
              
              
                        /* Trying to figure out font size for the number of lines to cover the document height                    */
                        /* and getting setting text area to cover the document was a trip. Adobe Postscript trip          */
                        /* I believe that 72 or 72.27 Point/Pica Size Photoshop Preference maybe I should see if          */
                        /* I could retrieve it. Anyway mine is set to 72 Setting the document resolution taking                    */
                        /* the document width and dividing by 72 would probably yield number of characters that                    */
                        /* would fit in the document width. Setting the documents resolution comes into play                    */
                        /* with Photoshop text support. Using the documents height and dividing the by the number          */
                        /* of lines of text I needed I hoped would yield the font size I needed. However that                    */
                        /* did not work the text area was correct the number of text lines did not fit. I needed          */
                        /* to use a smaller font.  When the document resolution is set to 72 DPI and I set a text          */
                        /* layer font size to 72 and the text area the number of pixels I want and observing                    */
                        /* Photoshop's text options bar there I see a one 1 to one relationship. 72 px = 72 px.                    */
                        /* If I set the documents resolution lower and set a Photoshop text layer font size to                    */
                        /* 72 px I see Photoshop scale the number to a lower number of pixels in the option bar.          */
                        /* Just what I needed. Setting the Documents resolution to 60 DPI let the number of line          */
                        /* I needed fit on the document. However Photoshop also scaled the text area I set down                    */
                        /* in size and that number of lines did not fit within that area. I needed to scale the                    */
                        /* text area up. Scaling the Text area up using 72/resolution did the trick...                               */
                      var testres = 60;
                        res = app.activeDocument.resolution;
                        if(res!=testres){ app.activeDocument.resizeImage(app.activeDocument.width.value,app.activeDocument.height.value,testres); }
              
              
              
              
              
              
                        /* Define var to be used to avoid undefined */
                        var expTime = "";
                        var expPgm = "";
                        var expCmp = "";
                        var mtrMode = "";
                        var ev = "";
                        var flshCode = "";
                        var flshMode = "";
                        var focLength = "";
                        var Fstop = "";
                        var ISO = "";
                        var Model = "";
                        var CameraModel = "";
                        var Artist = "";
                        var maxF = "";
                        var wbMode = "";
                        var phoTime = "";
                        var picYr = "";
                        var lens = "";
                        var cpyrt = "";
                        var remShutter = "";
                        var remAperture = "";
                        var remISO = "";
              
              
                        var docName = app.activeDocument.name;
                        /* END var to be used to avoid undefined */
              
              
                        try {   // get active document
                                  var doc = app.activeDocument;
                        }
                        catch (e){
                                  alert("No Document Open..." );
                        }
              
              
                        var exifInfo = "";
              
              try {
                                  // alert( "doc.info.exif=" + doc.info.exif );
                                  var numExifItems = doc.info.exif.length;
                                  // alert( "numExifItems=" + numExifItems );
                              for (var i = 0; i < doc.info.exif.length; i++){
                                             exifInfo = exifInfo + doc.info.exif[i][0] + " = " + doc.info.exif[i][1] + "\r";
              
              
              /* ---------------------------------- Extracting Data I want to Stamp  formated ----------------------------------------------------------------------- */
                                      checkThisItem(doc.info.exif[i][0], doc.info.exif[i][1])
                                            key=doc.info.exif[i][0];
                                            keyData=doc.info.exif[i][1];
              
              
                                            if (key == "Artist") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      Artist =("By " + keyData + "  ");
                                            }
                                             if (key == "Date Time Original") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      var phoTime = keyData;
                                                      var dateArray1 = phoTime.split(" ", 2);
                                                      phoTime = dateArray1[0];
                                                      phoHour = dateArray1[1];
                                                      var dateArray2 = phoTime.split(":");
                                                      var monthsArray = ["January","February","March","April","May","June","July","August","September","October","November","December"];
                                                      phoTime = monthsArray[dateArray2[1]-1]+" " + dateArray2[2]+ ", " + dateArray2[0] +" @ " + phoHour;
                                                      var picYr = dateArray2[0];
                                            }
                                            if (key == "Model") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      Model = (keyData + "  ");
                                            }
                                            if (key == "Max Aperture Value") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      maxF = ("maxF " + keyData + " ");
                                                      maxF = ( keyData + " ");
                                            }
                                            if (key == "Focal Length") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      focLength = ("@ " +keyData + "  ");
                                            }
                                            if (key == "Exposure Program") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      expPgm = (keyData + "  ");
                                                      if (expPgm == "Not defined") { expPgm = "Exposure Program Not Recorded  "; }
                                            }
                                            if (key == "Exposure Bias Value") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      expCmp = ("Bias " + keyData + "  ");
                                            }
                                            if (key == "Metering Mode") {
                                                      //alert ("Key=" + key + " Data=" + keyData );
                                                      mtrMode = (keyData + " Metering  ");
                                            }
                                            if (key == "White Balance") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      wbMode = ("White Balance " + keyData + "  ");
                                            }
                                            if (key == "ISO Speed Ratings") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      ISO = ("ISO " + keyData + "  ");
                                                      remISO = keyData;
                                            }
                                            if (key == "Exposure Time") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      expTime = ("Tv " + keyData + "  ");
                                                      remShutter = keyData;
                                            }
                                            if (key == "F-Stop") {
                                                      //alert ("Key=" + key + " Data=" + keyData );
                                                      Fstop = ("Av " + keyData + "  ");
                                                      remAperture = keyData;
                                            }
                                            if (key == "Flash") {
                                                      // alert ("Key=" + key + " Data=" + keyData );
                                                      var flshCode = keyData;
                                                      var flshMode = "Flash Code=" + flshCode + "  ";
                                                      if(flshCode==1){var flshMode = "Firing Flash   ";}
                                                      if(flshCode==9){var flshMode = "Firing Flash   ";}
                                                      if(flshCode==25){var flshMode = "Firing Flash   ";}
                                                      if(flshCode==89){var flshMode = "Firing Flash   ";}
                                                      if(flshCode==0){var flshMode = "without Flash   ";}
                                                      if(flshCode==16){var flshMode = "without Flash   ";}
                                                      if(flshCode==88){var flshMode = "without Flash   ";}
                                            }
                                  }
              
              
                                  /* Copyright Year(s) */
                                  var thisYr, toDay 
                                  var toDay = new Date();
                                  var thisYr = toDay.getYear() + 1900;
                                  if(picYr!="" && thisYr!=""){ var cpyrt =  picYr + "-" + thisYr + "  ";}
                                  if(picYr=="" && thisYr!=""){ var cpyrt =  thisYr + "  ";}
                                  if(picYr==thisYr){ var cpyrt =  thisYr + "  ";}
                                  /* For cameras that don't set Artist or set unknown in the Exif substitute Owner if set */
                                  if(Artist=="" && Owner!=""){var Artist = "By  " + Owner + "   ";}
                                  if(Artist=="By unknown  " && Owner!=""){var Artist = "By  " + Owner + "   ";}
                                  /*  Lens info  */
                                  xml = app.activeDocument.xmpMetadata.rawData;
                                  lensOffset = xml.indexOf("<aux:Lens>") + "<aux:Lens>".length;
                                  if(lensOffset > 0) {
                                            lens = xml.substr(lensOffset, xml.length - lensOffset);
                                            lens = lens.substr(0,lens.indexOf("</aux:Lens>"));
                                  }
                                  /* Hack for my cameras with fixed lens */
                                  if(lens=="" && Model=="E990  "){var lens = "9-28mm";}
                                  if(lens=="" && Model=="E-20,E-20N,E-20P  "){var lens = "9-36mm";}
                                  if(lens=="" && Model=="E-10  "){var lens = "9-36mm";}
                                  if(lens=="" && Model=="E-10          "){
                                            var Model = "E-10  ";
                                            var lens = "9-36mm";
                                  }
                                  if(lens=="" && Model=="Canon PowerShot SD700 IS  "){var lens = "5.8-23.2mm";}
                                  if(lens!=""){var lens = lens + "  ";}
                                  else {var lens = "Unknown Lens  ";}
                                  /* Hack for my ultra compact cameras program mode not recorded */
                                  if(Model=="Canon PowerShot SD700 IS  "){var expPgm = "Ultra Compact Camera  ";}
              
              
                                  //alert (remShutter + " " + remAperture + " " + remISO);
                              ev = calcEV(remShutter, remAperture, remISO);
              
              
              
              
              /* ---------------------------------- END Extracting Data I want to Stamp  formated -------------------------------------------------- */
              
                                  //}
                        }
                        catch (e){
                                  alert("No EXIF data exists..." );
                        }
              
              
              
              
                        if ( exifInfo == "" ) {
                                  alert( "No EXIF data exists..." );
                        }
                        else {
                                  // alert( "exifInfo=" + exifInfo );
              
              
                                  text_layer = doc.artLayers.add();                                                            // Add a Layer
                                  text_layer.name = "EXIF Stamp";                                                                      // Name Layer
                                  text_layer.kind = LayerKind.TEXT;                                                            // Make Layer a Text Layer
                                  text_layer.textItem.color = textColor;                                                            // set text layer color
              
              
              /* Do not set TextType to Pargarph Text for StampEXIF so action can position text layer
                                   text_layer.textItem.kind = TextType.PARAGRAPHTEXT;                                        // Set text layers text type
               */
              
              
                                  text_layer.textItem.font = fontName;                                                            // set text font
                                  text_layer.blendMode = BlendMode.NORMAL                                                            // blend mode
                                  text_layer.textItem.fauxBold = false;                                                            // Bold
                                  text_layer.textItem.fauxItalic = false;                                                            // Italic
                                  text_layer.textItem.underline = UnderlineType.UNDERLINEOFF;                              // Underlibn
                                  text_layer.textItem.capitalization = TextCase.NORMAL;                                        // Case
                                  text_layer.textItem.antiAliasMethod = AntiAlias.SHARP;                                        // antiAlias
              
              
              //                    var fontSize = Math.round((doc.height- textY) / ((numExifItems +1) * sizeFactor)); // Calulate font size to use Item nomber + last \r
                                  /* Calulate font size to use for StampExit keep size same for landscape and portrait base on document size */
                                  if (doc.width >= doc.height) {var fontSize = Math.round(doc.height / (30 * sizeFactor));}
                                  else {var fontSize = Math.round(doc.width / (30 * sizeFactor));}
                                  if (fontSize<10){fontSize=10};                                                                      // don't use Font size smaller then 10
                                  text_layer.textItem.size = fontSize;                                                            // set text font Size
              
              
              //                    text_layer.textItem.position = Array(textX, textY );                                        // set text layers position in and down
                                  text_layer.textItem.position = Array(textX, (textY + fontSize ));                    // set text layers position in and down for Stamp add in fontsize
              
              
                                  textWidth = ((doc.width - textX) * 72/testres );                                        // Text width document width - offset
                                  textHeight = ((doc.height - textY) * 72/testres );                                        // Text height document height - offset
              /* Do not set Text Area for StampEXIF so action can position text layer
                                  text_layer.textItem.width = textWidth;                                                            // set text area width
                                  text_layer.textItem.height = textHeight;                                                  // set text area height
               */
              
              
              /*
                                   alert(
                                  "res=" + res + " sizeFactor=" + sizeFactor + " numExifItems=" + numExifItems
                                  + "\r" + "fontsize=" + fontSize + " font=" +fontName
                                  + "\r" + "Image area width=" + doc.width + " height=" + doc.height
                                  + "\r"          + "text area width=" + textWidth + " height=" + textHeight
                                  + "\r"          + "Text Position top left=" + textX + "," + textY
                                  + " bottom right=" + (textX + textWidth )+ "," + (textY +  textHeight )
                                  );
               */
              
              
              /*
                                  try{
                                            text_layer.textItem.contents = exifInfo;
                                  }
                                  catch (er) {
                                            alert("Error Setting Contents...");
                                  }
               */
              
              
              /* -----------------------------------------  Data Stamp  format ----------------------------------------------------------------------- */
                                  text_layer.textItem.contents =  "Picture  " + docName + "  Copyright \u00A9 " + Biz + " " + cpyrt
                                  + "\r" + Artist + phoTime
                                  + "\r" + Model  + lens + maxF + focLength
                                  + "\r" + expPgm + expCmp + mtrMode + ev
                                  + "\r" + wbMode + ISO  + expTime + Fstop + flshMode;
              
              
                                  if (app.activeDocument.info.instructions == "" ) {
                                            app.activeDocument.info.instructions = "Picture  " + docName + "  Copyright \u00A9 " + Biz + " " + cpyrt
                                            + "\r" + Artist + phoTime
                                            + "\r" + Model  + lens + maxF + focLength
                                            + "\r" + expPgm + expCmp + mtrMode + ev
                                            + "\r" + wbMode + ISO  + expTime + Fstop + flshMode;
                                  }
              
              
                        }
              
              
                        if(res != testres){ app.activeDocument.resizeImage(app.activeDocument.width.value,app.activeDocument.height.value,res); }
              
              
                        app.preferences.rulerUnits = strtRulerUnits;
                        app.preferences.typeUnits = strtTypeUnits;
              
              
              }
              ///////////////////////////////////////////////////////////////////////////////
              // END - main function
              ///////////////////////////////////////////////////////////////////////////////
              
              
              // -----------------------------------------
              // calcEV()
              // -----------------------------------------
              function calcEV(shutter, aperture, iso) {
                        evString = new String("");
                        isoValue = new Number(0);
                        shutterValue = new Number(0);
                        apertureValue = new Number(0);
                        evValue = new Number(0);
                        apertureValue = aperture;
                        apertureValue = apertureValue.substr(2,apertureValue.length -2); // Strip off "f/"
                        shutterValue = shutter;
                        shutterValue = shutterValue.substr(0,shutterValue.indexOf(" ")); // Strip off ending " sec"
                        if ( shutterValue.indexOf("/") != -1) {
                                  topShutter = shutterValue.substr(0,shutterValue.indexOf("/"));
                                  bottomShutter = shutterValue.substr(shutterValue.indexOf("/") + 1,shutterValue.length -(shutterValue.indexOf("/") + 1));
                                  shutterValue = topShutter / bottomShutter;
                        }
                        isoValue = iso;
                        //alert ("apertureValue = " + apertureValue +  " shutterValue = " + shutterValue + " isoValue = " + isoValue );
                        if (isoValue>0 && shutterValue>0 && apertureValue>0) {
                                  evValue = Math.LOG2E * Math.log(Math.pow(apertureValue, 2) * (1 / shutterValue) * (100 / isoValue));
                                  evValue = Math.round(evValue * 10) / 10;
                                  evString = "EV " + evValue;
                        }
                        return evString;;
              }
              
              
              function checkThisItem(key, keyData) {
                        // alert("Key=" + key + " Data=" + keyData );
              
              
              }
              
              
              /* -------------------------------------------------------------------------------------------
              
              
              Image Description                    =
              Make                                        = NIKON
              Model                                        = E990
              Orientation                              = Normal
              X Resolution                              = 300.0
              Y Resolution                              = 300.0
              Resolution Unit                              = Inches
              Software                              = E990v1.0
              Date Time                              = 2000:09:01 08:11:14
              yCbCr Positioning                    = Cosited
              Exposure Time                              = 1/120 sec
              F-Stop                                        = f/2.5
              Exposure Program                    = Normal program
              ISO Speed Ratings                    = 100
              ExifVersion                              = 0210
              Date Time Original                    = 2000:09:01 08:11:14
              Date Time Digitized                    = 2000:09:01 08:11:14
              Compressed Bits Per Pixel          = 3.0
              Exposure Bias Value                    = 0.00
              Max Aperture Value                    = f/3.4
              Metering Mode                              = Pattern
              Light Source                              = Unknown
              Flash                                        = 1
              Focal Length                              = 8.2 mm
              FlashPix Version                    = 0100
              Color Space                              = sRGB
              Pixel X Dimension                    = 2048
              Pixel Y Dimension                    = 1536
              File Source                              = DSC
              Scene Type                              = Direct Photographed Image
              ---------------------------------------------------------------------------------------------------------------------
              Image Description                    = The Prominaide Image Name %SHORT_FILE_NAME%
              Width %IMAGE_WIDTH% Hight %IMAGE_HEIGHT% Size %IMAGE_SIZE_M% MB
              Make                                        = OLYMPUS OPTICAL CO.,LTD
              Model                                        = E-20,E-20N,E-20P
              Orientation                              = Normal
              X Resolution                              = 144.0
              Y Resolution                              = 144.0
              Resolution Unit                              = Inches
              Software                              = Adobe Photoshop 7.0
              Date Time                              = 2002:06:21 11:34:53
              Artist                                        = John J McAssey
              yCbCr Positioning                    = Cosited
              Copyright                              = Mr McMouse
              Exposure Time                              = 1/50 sec
              F-Stop                                        = f/5.6
              Exposure Program                    = Aperture priority
              ISO Speed Ratings                    = 80
              ExifVersion                              = 0210
              Date Time Original                    = 2002:05:15 17:26:51
              Date Time Digitized                    = 2002:05:15 17:26:51
              Components Configuration          = yCbCr
              Exposure Bias Value                    = 0.00
              Max Aperture Value                    = f/2.0
              Metering Mode                              = Spot
              Flash                                        = 0
              Focal Length                              = 9.0 mm
              FlashPix Version                    = 0100
              Color Space                              = Uncalibrated
              Pixel X Dimension                    = 2560
              Pixel Y Dimension                    = 1920
              File Source                              = DSC
              -------------------------------------------------------------------------------------------------------------
              Image Description                    = OLYMPUS DIGITAL CAMERA
              Make                                        = OLYMPUS OPTICAL CO.,LTD
              Model                                        = E-10
              Software                              = 42-0133
              Date Time                              = 2004:06:01 15:29:17
              Exposure Time                              = 1/125 sec
              F-Stop                                        = f/3.2
              Exposure Program                    = Normal program
              ISO Speed Ratings                    = 80
              ExifVersion                              = 0210
              Date Time Original                    = 2004:06:01 15:29:17
              Date Time Digitized                    = 2004:06:01 15:29:17
              Shutter Speed                              = 1/125 sec
              Aperture Value                              = f/3.2
              Exposure Bias Value                    = 0.00
              Max Aperture Value                    = f/2.0
              Metering Mode                              = Center Weighted Average
              Flash                                        = 1
              Focal Length                              = 20.0 mm
              File Source                              = DSC
              CFA Pattern                               = IFD Segment, ID = 41730
              -----------------------------------------------------------------------------------------------------------------
              Make                                         = Canon
              Model                                         = Canon EOS-1D Mark II
              Orientation                              = Normal
              X Resolution                              = 240.0
              Y Resolution                              = 240.0
              Resolution Unit                              = Inches
              Software                              = Adobe Photoshop CS3 Windows
              Date Time                              = 2008:07:26 18:52:35
              Artist                                        = McAssey
              Exposure Time                              = 1/60 sec
              F-Stop                                        = f/5.6
              Exposure Program                    = Normal program
              ISO Speed Ratings                    = 400
              ExifVersion                              = 0221
              Date Time Original                    = 2008:04:05 15:14:29
              Date Time Digitized                    = 2008:04:05 15:14:29
              Shutter Speed                              = 1/60 sec
              Aperture Value                              = f/5.6
              Exposure Bias Value                    = 0.00
              Max Aperture Value                    = f/2.8
              Metering Mode                              = Pattern
              Flash                                        = 9
              Focal Length                              = 50.0 mm
              Color Space                              = sRGB
              Pixel X Dimension                    = 3504
              Pixel Y Dimension                    = 2336
              Focal Plane X Resolution          = 3098.592
              Focal Plane Y Resolution          = 3097.884
              Focal Plane Resolution Unit          = Inches
              Custom Rendered                              = Normal Process
              Exposure Mode                              = Auto
              White Balance                              = Auto
              Scene Capture Type                    = Standard
              ------------------------------------------------------------------------------------------------------------------
              Make                                        = Canon
              Model                                        = Canon EOS 20D
              Date Time                              = 2007:09:03 11:29:24
              Artist                                        = John J McAssey
              Exposure Time                              = 1/800 sec
              F-Stop                                        = f/10
              Exposure Program                    = Normal program
              ISO Speed Ratings                    = 400
              ExifVersion                              = 0221
              Date Time Original                    = 2007:09:03 11:29:24
              Date Time Digitized                    = 2007:09:03 11:29:24
              Shutter Speed                              = 1/800 sec
              Aperture Value                              = f/10
              Exposure Bias Value                    = 0.00
              Max Aperture Value                    = f/5.6
              Metering Mode \                              = Pattern
              Flash                                        = 16
              Focal Length                              = 600.0 mm
              Focal Plane X Resolution          = 3959.322
              Focal Plane Y Resolution          = 3959.322
              Focal Plane Resolution Unit          = Inches
              Custom Rendered                              = Normal Process
              Exposure Mode                              = Auto
              White Balance                              = Manual
              Scene Capture Type                    = Standard
              -----------------------------------------------------------------------------------------------------------------------------
              Make                                        = Canon
              Model                                        = Canon PowerShot SD700 IS
              Orientation                              = Normal
              X Resolution                              = 180.0
              Y Resolution                              = 180.0
              Resolution Unit                              = Inches
              Date Time                              = 2007:02:25 12:39:01
              yCbCr Positioning                    = Centered
              Exposure Time                              = 1/320 sec
              F-Stop                                        = f/11
              ExifVersion                              = 0220
              Date Time Original                    = 2007:02:25 12:39:01
              Date Time Digitized                    = 2007:02:25 12:39:01
              Compressed Bits Per Pixel          = 5.0
              Shutter Speed                              = 1/320 sec
              Aperture Value                              = f/11
              Exposure Bias Value                    = 0.00
              Max Aperture Value                    = f/5.5
              Metering Mode                              = Pattern
              Flash                                        = 88
              Focal Length                              = 23.2 mm
              FlashPix Version                    = 0100
              Color Space                              = sRGB
              Pixel X Dimension                    = 1600
              Pixel Y Dimension                    = 1200
              Focal Plane X Resolution          = 7111.111
              Focal Plane Y Resolution          = 7100.592
              Focal Plane Resolution Unit          = Inches
              Sensing Method                              = One-chip color area sensor
              File Source                              = DSC
              Custom Rendered                              = Normal Process
              Exposure Mode                              = Auto
              White Balance                              = Auto
              Digital Zoom Ratio                    = 1.0
              Scene Capture Type                    = Standard
              
              
               */
              
              
              
              • 5. Re: Is there a way to extract an image file metadata?
                JWJB Community Member

                @JJMack, thanks for an informative post as usual.

                 

                I did have one questions along these lines though. I have been trying to find a script for appending a unique image id to the filename of my .psd, .tif and .jpq files using Photoshop or Bridge CS5.

                 

                I have looked far and wide and do see a number of tools for extracting Exif data, but since many of my images are from scans I do not have access to these data and even in the cases that I do, I still think an external way of appending a unique identifier to the filename would be a great help in the DAM workflow.

                 

                So I was hoping that there was a script that would be able to append a unique instance id, much like the URL Shortener programs goo.gl and bit.ly which shorten URLs to just 5 alphanumeric characters and not the unwieldy 32 hexadecimal digits instance id's used in XMP, GUID and UUID identifiers.

                 

                Basically, I just want to be able to append a unique identifier that is more sophisticated than adding the unique image id metadata or sequence numbers available in renaming files in Bridge as these numbers are not really unique like the examples above and require a lot of manual overhead to make sure files are uniquely named as these files are coming from multiple unconnected computers and scanners.

                 

                Any help you could provide would be greatly appreciated and I have learned a lot from your many posts these last few years even though this is the first post of yours I have replied to.

                • 6. Re: Is there a way to extract an image file metadata?
                  TLL... Community Member

                  You can try the PS-Scripts forum too. A huge pool of automation talent there...

                  • 7. Re: Is there a way to extract an image file metadata?
                    JWJB Community Member

                    @TLL..., thanks and that was one of the sites I looked through, but I did not find a script for the above so I thought I would post here especially since I have not received an email with my credentials to post at: http://www.ps-scripts.com/. Again, thanks for the excellent suggestion.

                    • 8. Re: Is there a way to extract an image file metadata?
                      JJMack Community Member

                      You must remember that Photoshop is not a file editor. If you want to rename a file you need to use a program like the Bridge  that is a metadata editor and can rename files. Or just some rename utility.

                       

                      You never stated how you would generate your more sophisticated id for your scans. Renaming is not be a problem what seems to need work is you id generation process. You need to come up with a ID Generating Process like a UUID process that fill your needs.

                      • 9. Re: Is there a way to extract an image file metadata?
                        Paul Riggott Community Member

                        Both Photoshop and Bridge are capable of bulk renaming, so it would be best to post in the relevant forum.
                        Besides www.ps-scripts.com there are a couple of Adobe forums

                         

                        Photoshop scripting forum
                        http://forums.adobe.com/community/photoshop/photoshop_scripting?view=discussions

                         

                        Bridge scripting forum
                        http://forums.adobe.com/community/bridge/bridge_scripting?view=discussions

                         

                        It might be best to let people know if you are after someone writing a script for you or just help creating one.


                        Give a bit of information of what you require IE:-
                        If you want to rename:-
                        All files in a folder
                        Selected files
                        Files of a given type(s)
                        Include subfolders
                        Etc.

                         

                        Another consideration is, if are wanting to rename raw files (nef,cr2 etc) the xmp files would need to be renamed to match.

                         

                        For an unique suffix/prefix you could use the time in milliseconds since 1970 as this is available on all computer systems or the last few numbers of.

                         

                        The more information you put in the post, the more likely you will get a positive response.

                        Good luck.

                        • 10. Re: Is there a way to extract an image file metadata?
                          JWJB Community Member

                          @Paul Riggott and @JJMack, thanks for your suggestions and I will add some additional information in my question and post at the suggested scripting forums.