EXIF data being stripped .NEF→.DNG — A Workaround…

  This is in reference to my previous thread, EXIF data being stripped .NEF→.DNG.

  I stand by my position that it is inappropriate and unethical for Photo AI to be stripping these data out of anyone’s files, without letting the user know that this is being done, and giving the user an option to have it not do so.

  The developers here, seem intent in stubbornly continuing to do so, and on making bullsh•• excuses for why they claim it should be done.  Their excuses are not the least bit convincing, to me.

  I am starting this thread, to share a crude workaround, to repair the vandalism that this software continues to commit against my image files.

  First, it is necessary that EXIFTOOL be installed.  The official site for EXIFTOOL is at https://exiftool.org/.  I have had some issues with the official installer, and have had better results using an alternate installer found at https://oliverbetz.de/pages/Artikel/ExifTool-for-Windows.

  For more generalized purposes, I have create this batch file, which I call CPEXIF.BAT, which uses EXIFTOOL to copy all of the available EXIF data from one file to another.  For some time, now, it has been my practice to use this to copy the EXIF data from the source .NEF file from my camera, to the .DNG file created by Photo AI, restoring those data which Photo AI has inappropriately stripped.

  Here is the content of CPEXIF.BAT

exiftool -TagsFromFile %1 %2
move /y %2_original %temp%

  More recently, I have added a batch file, FixEXIF.bat which calls a program FixEXIF_Filter.exe.

  Here is FixEXIF.bat

dir /b | FixEXIF_Filter

  And here is the C source for FixEXIF_Filter.exe

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <errno.h>


int main(int argc, char *argv[])
{
 char line[1024];

 fgets(line,1023,stdin);
  while(!feof(stdin))
  {
   register int c0,c1;

   c0 = strnicmp(line+1,"SC_",3);
   c1 = strnicmp(line+8,"-topaz",6);
    if(!(c0 || c1))
    {
     char cmd[1024];
     register int ii,il;

     strcpy(cmd,"call cpexif D");
     il = strlen(cmd) -1;
     for(ii=1;ii<=7;ii++)  cmd[il+ii] = line[ii];
     cmd[il+ii] = '\0';
     strcat(cmd,".NEF ");
     strcat(cmd,line);
     cmd[strlen(cmd)-1] = '\0';
     system(cmd);
    }
   fgets(line,1023,stdin);
  }
 return(0);
}

  There may be more elegant ways to write this than how I wrote it.  I used to be very good at programming in C, but that was a very, very, very long time ago.  What recent attempts I have made to write in C have often involved a lot more fumbling around, just trying to remember how to do it, than actually coding.

  Anyway, it’s pretty straightforward. FixEXIF.bat uses dir /b to generate a list of all the files in the current directory; and pipes it into FixEXIF_Filter.exe.

  FixEXIF_Filter.exe scans its input, looking for filenames of the form ?SC-????-topaz* which it assumes to be files that have been processed by Photo AI, constructs a command line to CPEXIF the data from the corresponding .NEF file to the file so identified, and then uses system() to execute that command.

This topic was automatically closed after 60 days. New replies are no longer allowed.