@ echo off rem rem File: lr-ccc-equalize.bat rem rem Description: Microsoft Windows batch file calling exiftool and exiftool arguments file. Process equalizes rem caption, creator and copyright metadata across all relevant JPG, CR2 and XMP file metadata fields. rem rem Purpose: To match all caption, creator and copyright metadata fields to the same values. rem rem Reason: Many photo organizing and editing tools allow the change of one or more rem metadata fields. Doing so leaves the photo file(s) with some metadata fields that rem do not match. Different photo geotagging, organizing and editing tools, as well as rem photo hosting web sites, display different metadata fields for the photos. rem This can cause many problems related to mismatched captions, labels, titles, etc. rem on the same photo. By equalizing, or matching, the metadata across all relevent metadata fields, rem the photos will be treated, processed, displayed, etc. the same by all photo tools and web sites. rem rem rem Usage: 1. Using Windows Explorer or a command line, place this batch file and the rem lr-ccc-equalize.args in the folder/directory with the photos you wish to process rem rem 2. Using Windows Explorer or a command line, execute the batch file. rem -Windows Explorer: double click the lr-ccc-equalize.bat file rem -command line: lr-ccc-equalize.bat rem rem rem Revisions: 2011/07/12 - V1.00 Douglas Hackney created contact: dhackney@egltd.com rem rem rem References: metadata: http://www.metadataworkinggroup.org/specs/ rem http://www.hackneys.com/travel/docs/metadataoverview.pdf rem http://www.hackneys.com/travel/docs/photo-metadata-ccc.xls rem exiftool: http://www.sno.phy.queensu.ca/~phil/exiftool/exiftool_pod.html rem rem Notes: rem * This batch file processes all xmp, cr2 and jpg files in a directory and its subdirectories. rem rem * This batch file requires the parameter file lr-ccc-equalize.args for data field mapping. rem rem * Put this batch file and the lr-ccc-equalize.args file in the directory with the files you rem wish to process. rem rem * This batch file processes Canon CR2 (RAW) files first, then JPG files. rem rem * If you wish to use this utility for non-Canon RAW files, edit the file name extension CR2 and cr2 rem below to your applicable RAW filetype extension, e.g., NEF. rem rem * To see more detail about the operations performed, add a -v to the exiftool command lines below. rem The level of detail increases with each of the following increments of the variable: rem -v, -v0, -v1, -v2, -v3, -v4, -v5 rem rem * This batch file requires an installed copy of ExifTool by Phil Harvey. rem rem * Download the ExifTool windows command line version and rename the file exiftool.exe. rem rem * Place the exiftool.exe file in your windows directory or on your system path. rem rem Warning: rem *************************************************************************************** rem rem --> This process overwrites the original files, so make sure you have a backup! <-- rem rem *************************************************************************************** rem rem rem ---------------------- Begin Code ------------------------------------------------------------------- Set CURRENTDIR=%CD% echo+ echo * * * Photo caption, creator and copyright equalize utility * * * echo+ echo Why? After running this utility, your photos will contain and display the same echo caption/description, creator and copyright information - echo regardless of the tool, system or web site you are using. echo+ echo This utility sets all caption, creator and copyright metadata fields to match echo the master fields in the lr-ccc-equalize.args file. echo+ echo This utility processes photo files in the current folder and its subfolders. echo The current folder is: %CURRENTDIR% echo+ echo All relevent caption, creator and copyright metadata fields are matched / echo equalized / synchronized in all JPG, XMP and CR2 files. echo+ echo This utility is optimized for use with photo files that were echo edited with Adobe Lightroom. Photo files edited with other programs may echo require you to edit the source to target field mapping. Metadata echo source to target field mapping is controlled by the file echo lr-ccc-equalize.args. echo+ echo This utility is optimized for use with Canon photo files. Other echo manufacturers' photo files may require editing the photo file extension type. echo Photo file extension type, e.g. .CR2 vs .NEF, is controlled by this echo batch file. echo+ echo This utility requires the free ExifTool program by Phil Harvey. echo+ echo For more information, view these files in Notepad and read the included echo documentation: echo lr-ccc-equalize.bat echo lr-ccc-equalize.args echo+ echo V1.00 echo+ pause cls echo+ echo * * * Photo caption, creator and copyright equalize utility * * * echo+ echo * * * * * * * W A R N I N G * * W A R N I N G * * W A R N I N G * * * * * * * echo+ echo ***************************************************************************** echo * * echo * This utility makes -NO- changes to the image data of the photo files. * echo * * echo * This utility makes -NO- changes to any date/time data. * echo * * echo * However, when writing the caption, creator and copyright metadata this * echo * process overwrites the original photo files. * echo * * echo * * * * T H E R E I S N O U N D O * * * * echo * * echo * Please backup your photo files prior to using this utility! * echo * * echo ***************************************************************************** echo+ echo * * * * * * * W A R N I N G * * W A R N I N G * * W A R N I N G * * * * * * * echo+ echo The caption, creator and copyright metadata for all JPG, CR2 and XMP files echo in the current folder and its subfolders will be matched / equalized / echo synchronized by this utility. echo+ echo Current folder: %CURRENTDIR% echo+ echo+ echo Press CNTRL and C together to stop this utility and leave your files unchanged. pause cls echo+ echo * * * Photo caption, creator and copyright equalize utility * * * echo+ echo Caption, creator and copyright metadata fields that will be matched / echo equalized / synchronized: echo+ echo EXIF: echo * Artist echo * Copyright echo * Image Description echo * Rating echo * User Comment echo IPTC: echo * By-line echo * By-line Title echo * Caption-Abstract echo * Category echo * City echo * Copyright Notice echo * Country-Primary Location Code echo * Country-Primary Location Name echo * Credit echo * Headline echo * Keywords echo * Object Name echo * Original Transmission Reference echo * Province-State echo * Source echo * Special Instructions echo * Sub-location echo * Supplemental Categories echo * Urgency echo * Writer-Editor echo JPEG echo * Comment echo Photoshop: echo * Copyright Flag echo * URL echo XMP-acdsee echo * Caption echo XMP-dc: echo * Creator echo * Description echo * Rights echo * Subject echo * Title echo XMP-exif echo * User Comment echo XMP-iptcCore: echo * Country Code echo * Creator Address echo * Creator City echo * Creator Country echo * Creator Postal Code echo * Creator Region echo * Creator Work Email echo * Creator Work Telephone echo * Creator Work URL echo * Intellectual Genre echo * Location echo * Scene echo * Subject Code echo XMP-lr: echo * Hierarchical Subject echo XMP-photoshop: echo * Authors Position echo * Caption Writer echo * Category echo * City echo * Country echo * Credit echo * Headline echo * Instructions echo * State echo * Source echo * Supplemental Categories echo * Transmission Reference echo * Urgency echo XMP-tiff echo * Image Description echo XMP-xmp: echo * Label echo XMP-xmpRights: echo * Copyright Flag echo * Usage Terms echo * Web Statement echo+ echo Target date/time fields set to the current date/time: echo * Metadata Date echo+ echo Note that different photo organizing, editing, geolocation and photo hosting echo applications and web sites display these metadata fields with a wide variety echo of labels that often DO NOT match these field names. echo+ echo Press CNTRL and C together to stop this utility and leave your files unchanged. pause cls echo+ echo * * * Photo caption, creator and copyright equalize utility * * * echo+ echo ***************************************************************************** echo * * echo * * * * * * I M P O R T A N T * * I M P O R T A N T * * * * * * echo * * echo * If you are using Adobe Lightroom (LR), Adobe Photoshop Elements (PSE) * echo * or any other photo organizer / editor that stores information external * echo * of the photo file itself, then you need to write or save the metadata * echo * to your photos PRIOR to running this utility and read or load the * echo * metadata from your photos back into Adobe Lightroom (LR), Adobe * echo * Photoshop Elements (PSE), etc., AFTER running this utility. * echo * * echo * PRIOR to running this utility: * echo * * echo * In Lightroom: * echo * 1. Select Library module * echo * 2. Select all photos that you intend to process with this utility * echo * 3. On the menu bar at the top of the window: * echo * a. select: Metadata * echo * b. select: Save metadata to files * echo * * echo * AFTER running this utility: * echo * * echo * In Lightroom: * echo * 1. Select Library module * echo * 2. Select all photos that you processed with this utility * echo * 3. On the menu bar at the top of the window: * echo * a. select: Metadata * echo * b. select: Read metadata from files * echo * * echo ***************************************************************************** echo+ echo Press CNTRL and C together to stop this utility and leave your files unchanged. pause cls echo+ echo * * * Photo caption, creator and copyright equalize utility * * * echo+ echo * * * * * * * W A R N I N G * * W A R N I N G * * W A R N I N G * * * * * * * echo+ echo ***************************************************************************** echo * * echo * This utility makes -NO- changes to the image data of the photo files. * echo * * echo * This utility makes -NO- changes to any date/time data. * echo * * echo * However, when writing the caption, creator and copyright metadata this * echo * process overwrites the original photo files. * echo * * echo * * * * T H E R E I S N O U N D O * * * * echo * * echo * Please backup your photo files prior to using this utility! * echo * * echo ***************************************************************************** echo+ echo * * * * * * * W A R N I N G * * W A R N I N G * * W A R N I N G * * * * * * * echo+ echo Note: echo * Use this utility at your own risk. echo * No warranties or suitability of use of any kind are expressed or implied. echo+ echo Warning: echo * The caption, creator and copyright metadata for all JPG, CR2 and XMP echo files in the current folder and its subfolders will be matched / echo equalized / synchronized by this utility. echo+ echo Current folder: %CURRENTDIR% echo+ echo ------------------------------------------------------------------------------ echo+ echo Press CNTRL and C together to stop this utility and leave your files unchanged. echo+ echo Press any key to run this utility and equalize all caption, creator and echo copyright metadata fields. echo+ pause cls echo+ echo * * * Photo caption, creator and copyright equalize utility * * * echo+ echo This is a four step process. echo+ echo You can ignore error messages related to string length in steps 1 and 2. echo+ echo It is normal to see error messages regarding missing .xmp files in step 3. echo+ echo+ rem ======================== Text File Data Begin ========================== rem set up text file header echo+>lr-ccc-equalize.txt echo * * * Photo caption, creator and copyright equalize utility * * *>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Utility run on: %date% %time%>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Run in folder and its subfolders: %CURRENTDIR%>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo ---------------------------------------------------------------------------->>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo The following caption, creator and copyright metadata fields will be matched />>lr-ccc-equalize.txt echo equalized / synchronized:>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo EXIF:>>lr-ccc-equalize.txt echo * Artist>>lr-ccc-equalize.txt echo * Copyright>>lr-ccc-equalize.txt echo * Image Description>>lr-ccc-equalize.txt echo * Rating>>lr-ccc-equalize.txt echo * User Comment>>lr-ccc-equalize.txt echo IPTC:>>lr-ccc-equalize.txt echo * By-line>>lr-ccc-equalize.txt echo * By-line Title>>lr-ccc-equalize.txt echo * Caption-Abstract>>lr-ccc-equalize.txt echo * Category>>lr-ccc-equalize.txt echo * City>>lr-ccc-equalize.txt echo * Copyright Notice>>lr-ccc-equalize.txt echo * Country-Primary Location Code>>lr-ccc-equalize.txt echo * Country-Primary Location Name>>lr-ccc-equalize.txt echo * Credit>>lr-ccc-equalize.txt echo * Headline>>lr-ccc-equalize.txt echo * Keywords>>lr-ccc-equalize.txt echo * Object Name>>lr-ccc-equalize.txt echo * Original Transmission Reference>>lr-ccc-equalize.txt echo * Province-State>>lr-ccc-equalize.txt echo * Source>>lr-ccc-equalize.txt echo * Special Instructions>>lr-ccc-equalize.txt echo * Sub-location>>lr-ccc-equalize.txt echo * Supplemental Categories>>lr-ccc-equalize.txt echo * Urgency>>lr-ccc-equalize.txt echo * Writer-Editor>>lr-ccc-equalize.txt echo JPEG>>lr-ccc-equalize.txt echo * Comment>>lr-ccc-equalize.txt echo Photoshop:>>lr-ccc-equalize.txt echo * Copyright Flag>>lr-ccc-equalize.txt echo * URL>>lr-ccc-equalize.txt echo XMP-acdsee>>lr-ccc-equalize.txt echo * Caption>>lr-ccc-equalize.txt echo XMP-dc:>>lr-ccc-equalize.txt echo * Creator>>lr-ccc-equalize.txt echo * Description>>lr-ccc-equalize.txt echo * Rights>>lr-ccc-equalize.txt echo * Subject>>lr-ccc-equalize.txt echo * Title>>lr-ccc-equalize.txt echo XMP-exif>>lr-ccc-equalize.txt echo * User Comment>>lr-ccc-equalize.txt echo XMP-iptcCore:>>lr-ccc-equalize.txt echo * Country Code>>lr-ccc-equalize.txt echo * Creator Address>>lr-ccc-equalize.txt echo * Creator City>>lr-ccc-equalize.txt echo * Creator Country>>lr-ccc-equalize.txt echo * Creator Postal Code>>lr-ccc-equalize.txt echo * Creator Region>>lr-ccc-equalize.txt echo * Creator Work Email>>lr-ccc-equalize.txt echo * Creator Work Telephone>>lr-ccc-equalize.txt echo * Creator Work URL>>lr-ccc-equalize.txt echo * Intellectual Genre>>lr-ccc-equalize.txt echo * Location>>lr-ccc-equalize.txt echo * Scene>>lr-ccc-equalize.txt echo * Subject Code>>lr-ccc-equalize.txt echo XMP-lr:>>lr-ccc-equalize.txt echo * Hierarchical Subject>>lr-ccc-equalize.txt echo XMP-photoshop:>>lr-ccc-equalize.txt echo * Authors Position>>lr-ccc-equalize.txt echo * Caption Writer>>lr-ccc-equalize.txt echo * Category>>lr-ccc-equalize.txt echo * City>>lr-ccc-equalize.txt echo * Country>>lr-ccc-equalize.txt echo * Credit>>lr-ccc-equalize.txt echo * Headline>>lr-ccc-equalize.txt echo * Instructions>>lr-ccc-equalize.txt echo * State>>lr-ccc-equalize.txt echo * Source>>lr-ccc-equalize.txt echo * Supplemental Categories>>lr-ccc-equalize.txt echo * Transmission Reference>>lr-ccc-equalize.txt echo * Urgency>>lr-ccc-equalize.txt echo XMP-tiff>>lr-ccc-equalize.txt echo * Image Description>>lr-ccc-equalize.txt echo XMP-xmp:>>lr-ccc-equalize.txt echo * Label>>lr-ccc-equalize.txt echo XMP-xmpRights:>>lr-ccc-equalize.txt echo * Copyright Flag>>lr-ccc-equalize.txt echo * Usage Terms>>lr-ccc-equalize.txt echo * Web Statement>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Target date/time fields set to the current date/time:>>lr-ccc-equalize.txt echo * Metadata Date>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Note that different photo organizing, editing, geolocation and photo hosting>>lr-ccc-equalize.txt echo applications and web sites display these metadata fields with a wide variety>>lr-ccc-equalize.txt echo of labels that often DO NOT match these field names.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo ---------------------------------------------------------------------------->>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo This is a 4 step process.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Step 1 of 4:>>lr-ccc-equalize.txt echo Writing the data into the Canon CR2 RAW files.>>lr-ccc-equalize.txt rem ======================== Text File Data End ========================== echo Step 1 of 4: echo Writing the data into the Canon CR2 RAW files echo+ echo You may see error messages regarding string length in step 1. echo You can ignore "String too short..." error messages in step 1. echo+ rem rem The following command line writes the data into the Canon CR2 RAW files rem exiftool -tagsFromFile %%d/%%f.xmp -r -@ lr-ccc-equalize-raw.args -ext cr2 . -overwrite_original -v0>>lr-ccc-equalize.txt rem rem echo+ echo You may see error messages regarding string length in step 1. echo You can ignore "String too short..." error messages in step 1. echo+ echo Writing the data into the Canon CR2 RAW files complete. echo+ echo Step 1 of 4 completed. echo+ echo+ echo Step 2 of 4: echo Writing the data into the Canon CR2 RAW sidecar XMP files echo+ echo You may see error messages regarding string length in step 2. echo You can ignore "String too short..." error messages in step 2. rem ======================== Text File Data Begin ========================== echo+>>lr-ccc-equalize.txt echo Writing the data into the Canon CR2 RAW files complete.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Step 1 of 4 completed.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Step 2 of 4:>>lr-ccc-equalize.txt echo Writing the data into the Canon CR2 RAW sidecar XMP files.>>lr-ccc-equalize.txt rem ======================== Text File Data End ========================== rem rem The following command line writes the data into the Canon CR2 RAW sidecar XMP files rem exiftool -tagsFromFile %%d/%%f.xmp -r -@ lr-ccc-equalize-raw.args -ext xmp . -overwrite_original -v0>>lr-ccc-equalize.txt rem rem echo+ echo You may see error messages regarding string length in step 2. echo You can ignore "String too short..." error messages in step 2. echo+ echo Writing the data into the Canon CR2 RAW sidecar XMP files echo complete. echo+ echo Step 2 of 4 completed. echo+ echo+ echo Step 3 of 4: echo Writing the data into the Canon CR2 RAW sidecar JPG files echo+ echo It is normal to see error messages regarding missing .xmp files in step 3. echo You can ignore "Warning: Error opening file -" messages in step 3. echo+ rem ======================== Text File Data Begin ========================== echo+>>lr-ccc-equalize.txt echo Writing the data into the Canon CR2 RAW sidecar XMP files complete.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Step 2 of 4 completed.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Step 3 of 4:>>lr-ccc-equalize.txt echo Writing the data into the Canon CR2 RAW sidecar JPG files.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo It is normal to see error messages in step 3.>>lr-ccc-equalize.txt echo You can ignore "Nothing changed in" messages in step 3.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt rem ======================== Text File Data End ========================== rem rem The following command line writes the data into the Canon CR2 RAW sidecar JPG files rem exiftool -tagsFromFile %%d/%%f.xmp -r -@ lr-ccc-equalize-raw.args -ext jpg . -overwrite_original -v0>>lr-ccc-equalize.txt rem rem echo+ echo It is normal to see error messages regarding missing .xmp files in step 3. echo You can ignore "Warning: Error opening file -" messages in step 3. echo+ echo Writing the data into the Canon CR2 RAW sidecar JPG files echo complete. echo+ echo Step 3 of 4 completed. echo+ echo+ echo Step 4 of 4: echo Writing the data into the JPG files rem ======================== Text File Data Begin ========================== echo+>>lr-ccc-equalize.txt echo It is normal to see error messages regarding files in step 3.>>lr-ccc-equalize.txt echo You can ignore "Nothing changed in" messages in step 3.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Writing the data into the Canon CR2 RAW sidecar JPG files complete.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Step 3 of 4 completed.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Step 4 of 4:>>lr-ccc-equalize.txt echo Writing the data into the JPG files>>lr-ccc-equalize.txt rem ======================== Text File Data End ========================== rem rem The following command line writes the data into the JPG files rem exiftool -tagsFromFile %%d/%%f.jpg -r -@ lr-ccc-equalize-jpg.args -ext jpg . -overwrite_original -v0>>lr-ccc-equalize.txt echo+ echo Writing the data into the JPG files complete. echo+ echo Step 4 of 4 completed. echo+ echo+ echo Summary: echo 1. Writing the data into the Canon CR2 RAW files complete. echo 2. Writing the data into the Canon CR2 RAW sidecar XMP files echo complete. echo 3. Writing the data into the Canon CR2 RAW sidecar JPG files echo complete. echo 4. Writing the data into the JPG files complete. echo+ echo All steps complete. echo+ rem ======================== Text File Data Begin ========================== echo+>>lr-ccc-equalize.txt echo Writing the data into the JPG files complete.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Step 4 of 4 completed.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo Summary:>>lr-ccc-equalize.txt echo 1. Writing the data into the Canon CR2 RAW files complete.>>lr-ccc-equalize.txt echo 2. Writing the data into the Canon CR2 RAW sidecar XMP files>>lr-ccc-equalize.txt echo complete.>>lr-ccc-equalize.txt echo 3. Writing the data into the Canon CR2 RAW sidecar JPG files>>lr-ccc-equalize.txt echo complete.>>lr-ccc-equalize.txt echo 4. Writing the data into the JPG files complete.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt echo All steps complete.>>lr-ccc-equalize.txt echo+>>lr-ccc-equalize.txt rem ======================== Text File Data End ========================== pause cls echo+ echo * * * Photo caption, creator and copyright equalize utility * * * echo+ echo All caption, creator and copyright metadata fields are now matched / echo equalized / synchronized for all JPG, CR2 and XMP files in the current echo folder and its subfolders. echo+ echo Current folder: %CURRENTDIR% echo+ echo Now, your photos will always display the same caption, creator and echo copyright information - regardless of the tool, system or web site echo you are using. echo+ echo+ echo ***************************************************************************** echo * * echo * * * * * * I M P O R T A N T * * I M P O R T A N T * * * * * * echo * * echo * If you are using Adobe Lightroom (LR), Adobe Photoshop Elements (PSE) * echo * or any other photo organizer / editor that stores information externally * echo * of the photo file itself, then you need to now read or load the * echo * metadata from your photos back into Adobe Lightroom (LR), Adobe * echo * Photoshop Elements (PSE), etc. * echo * * echo * * echo * In Lightroom: * echo * 1. Select Library module * echo * 2. Select all photos that you processed with this utility * echo * 3. On the menu bar at the top of the window: * echo * a. select: Metadata * echo * b. select: Read metadata from files * echo * * echo ***************************************************************************** echo+ echo+ echo Detailed information regarding the JPG, CR2 and XMP photo files changed in echo this run of the utility is available in the text file: echo %CURRENTDIR%\lr-ccc-equalize.txt echo+ echo+ pause rem ---------------------- End Code -------------------------------------------------------------------