Panasonic Serial Number EXIF Field creation

Started by BangkokPhoto, November 08, 2016, 08:26:30 AM

Previous topic - Next topic

BangkokPhoto

Over the years I have owned several Panasonic DMC-GF2. I am attempting to get organized. Unfortunately there are many duplicate file names. Panasonic stores a unique "serial number" in EXIF as InternalSerialNumber. Is there any way I could use exiftool to create a new EXIF field "SERIALNUMBER" and copy the InternalSerialNumber field value to the new SerialNumber field? The goal is to get LR6 to recognize the serial number and I'll rename the files from LR based on Serial Number.

Phil Harvey

Try this:

exiftool "-serialnumber<internalserialnumber" DIR

(add -r if you want to recurse into subdirectories)

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BangkokPhoto

Thank you! I tested it on a small sample and noticed it somehow changed the date?

Phil Harvey

Add the -P option to preserve the original FileModifyDate.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BangkokPhoto

Sorry for my lack of knowledge. how to I "-p" for a directory of files?

Phil Harvey

capital "P", not lower case "p":

exiftool "-serialnumber<internalserialnumber" -P DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BangkokPhoto

I tested this on a small group of my GF2 files; it works well. I have jpg from many different cameras across many directories by date. How do I search and only change the GF2's files?

StarGeek

Check the Model tag.  Possible something like:
exiftool -P -if "$Model eq 'DMC-GF2'" "-serialnumber<internalserialnumber" FilesOrDir
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

BangkokPhoto

I apologize for the persistent annoyance and my lack of knowledge of exiftool command line.

I would like to copy all DMC-GF2 files (JPG+RW2) from the lightroom catalog (currently organized by date)... to a new location while adding the serial number and automatically renaming the duplicates (because they are not dupes (3 different bodies created the 3 same filenames). I do not have the space for exiftool to create .original copies... How could I do all this?

Phil Harvey

If you are copying out of the LR catalog then the _original files won't be created (ExifTool only makes one copy).

The command could look something like this:

exiftool "-serialnumber<internalserialnumber" -filename=DESTINATION_DIRECTORY/%f%-c.%e -P -if "$model eq 'DMC-GF2'" -r SOURCE_DIRECTORY

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

BangkokPhoto

-filename=DESTINATION_DIRECTORY/%f%-c.%e -P

what does the %f% - c.%e switch do?

Hayo Baan

%f is the original filename, %-c is a counter in case of duplicates, and %e is the original extension. Please see the documentation for more information.
Hayo Baan – Photography
Web: www.hayobaan.nl

BangkokPhoto

#12
I underestimated the problem. In addition to 3 GF2 bodies; I have also owned a Panasonic TS2 and TS3. Those compact cameras created dupe JPG filenames, so GF1, GF2, GF3, TS2, TS3. I tried to use EXIF tool to inject the serial numbers into the TS2/TS3 files but ran into countless offset errors with the TS2 files. Is there a problem with the TS2 files?

Hayo Baan

Yes, there is a (probably minor) with these files, probably some editing software put the makernotes at the wrong location. The good news is that it looks like it is fixable by exiftool, try out the the -F option of exiftool with the suggested offset on one or two files and verify the information is correct and that the image is still editable.
Hayo Baan – Photography
Web: www.hayobaan.nl

BangkokPhoto

I looked at the exif data for a few of the files and did not notice any errors in the data.