Photo toolbox - Photos organisieren

Eine persönliche Sammlung von Befehlen um Photosammlungen insbesondere mit RAW Bildern zu verwalten.

Some scripts with exiftool


The following scripts are used by my own and are adjusted for my needs. Check and test carefully whether it will fit your formats and requirements.

Integrate xmp Sidecars back into RAW Files for a whole folder


The following command copies the information of the sidecar back into a raw file (in this case from Nikon NEF) for a whole folder. So you might create a batch file and drag and drop a folder on the batch:
T:\path\to\exiftool\exiftool.exe" -overwrite_original -tagsfromfile %%d%%f.xmp "-all>xmp:all" -ext NEF %1 

Import images from SD or other folder


I had some problems around the new Nikon RAW Format and to adjust some issues I did my one import routine like you know from some catelogue software. The script will move the dragged images into a new folder by this pattern: 2014/12-31 Photosessiontitle . It will ask for the title and gets the latest date from the files. After copying it will load the default crs.xml (just create this file) to the files to store afterwards the filename in RawFilename. So you have to chance to find later original file or can detect thumbs.
<?xml version="1.0" encoding="utf-8" ?>
<x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 9.42'>
<rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'>
<rdf:Description rdf:about=""   xmlns:crs="http://ns.adobe.com/camera-raw-settings/1.0/">
         <crs:HasCrop>False</crs:HasCrop>
         <crs:HasSettings>False</crs:HasSettings>
         <crs:RawFileName>20130316_dsc_4735.nef</crs:RawFileName>
         <crs:Version>6.7</crs:Version>
      </rdf:Description>
</rdf:RDF>
</x:xmpmeta>

And after this all files are renamed to yyyy_mm_dd_filename to prevent having the same filenames sometimes in the future.
@echo off
set /p var=Enter destination folder: 

setlocal enabledelayedexpansion
set i=0
for /F %%A IN ('DIR /B /O:D %*') do (
    set /a i+=1
    set var!i!=%%A
    set NEWEST= %%A
)

"path\to\exiftool.exe"  -p $DateTimeOriginal %NEWEST% > "%temp%\imptmpfile"
set /p datum= < "%temp%\imptmpfile"
set var=%datum:~0,4%\%datum:~5,2%-%datum:~8,2% %var%

del "%temp%\imptmpfile"

mkdir "path\to\photos\%var%"

for /L %%J in (1, 1, %i%) do (
    call :kludge var%%J         
   copy  !this_value!  "path\to\photos\%var%"
)

"path\to\exiftool.exe" -tagsfromfile crs.xml "-all>xmp:all" "path\to\photos\%var%"   -overwrite_original
"path\to\exiftool.exe" "-rawfilename<filename" "path\to\photos\%var%"   -overwrite_original     
"path\to\exiftool.exe" "-filename<DateTimeOriginal" -d "%%Y%%m%%d_%%%%f.%%%%e" "path\to\photos\%var%" -overwrite_original

cd /d %1
pause
exit /b

:kludge
set this_value=!%1!
exit /b

Clean folder for backups


There a lot of files and stuff which are not need in a backup. I just delete the following:
  • thumb Files from Windows and Adobe Bridge
  • Temporary files from Geosetter and exiftool
  • integrate the xmp sidecars back to RAW.
  • remove all files which have the rating -1 (is in ViewNX the flag for remove)

There is a folder create where are some stuff is copied and will be emptied at startup.
d %1
mkdir "%temp%\trashtidy"
DEL /S "%temp%\trashtidy\*.*"

"path\to\exiftool.exe" -overwrite_original -tagsfromfile %%d%%f.xmp "-all>xmp:all"   -execute -srcfile %%d%%f.xmp -filename="%temp%\trashtidy\%%f%%c.xmp"  -common_args -r -ext NEF *

"path\to\exiftool.exe" -directory="%temp%\trashtidy"  -if "$rating eq -1" -r -ext NEF -ext CR2 -ext CRW -ext JPG *

DEL /S  /F/AH  .BridgeCacheT  .BridgeCache .thumbsdb *.NEF_original *._exiftool_tmp

pause

Execute ShiftN application on each marked photo


In your favorite tagging application you can set a keyword "ShiftN" and the following batch will execute each of this with the great ShiftN by Marcus Hebel and appends a suffix.
"path\to\exiftool.exe" -filename -s3 -if "$keywords=~/shiftn/" -p "$directory/$filename"  C:\Users\USER\Desktop\minim\*.JPG > C:\Users\USER\Desktop\minim\tmpFile
set SEARCHTEXT=.
set REPLACETEXT=_ShiftN.
cd "C:\Program Files (x86)\ShiftN"

SETLOCAL ENABLEDELAYEDEXPANSION
FOR /F %%a in (C:\Users\USER\Desktop\minim\tmpFile) DO (
set file="%%a"
set newfilename=!file:%SEARCHTEXT%=%REPLACETEXT%!
ShiftN.exe "!file!" "!newfilename!" A1
)

List all images with geo coordinates in a csv file


Generate a csv file with the filename, the rawfilename, gpsposition and the title. All coordinates are converted to numeric lat/lon. Walkes recursive through the folder.
T:\path\to\exiftool\exiftool.exe" -q -r -t -f -S -n -csv -fileName -rawfilename -GPSPosition -title %1 > T:\DATEINAME.csv

001

released 17.12.13

Initial

    Untertitel
    Photo Toolbox
    Stichworte
    • photo,
    • foto,
    • toolbox,
    • exiftool,
    • batch,
    • cmd,
    • windows,
    • organisation,
    • struktur,
    • umbennen,
    Änderungshistorie
      Text und Inhalte erstellt von
    • 12.01.2014 15:50 Allgemeine Änderung
    Permanent link
    http://rokdd.de/permanent:photo_toolbox