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.
Try this:
exiftool "-serialnumber<internalserialnumber" DIR
(add -r if you want to recurse into subdirectories)
- Phil
Thank you! I tested it on a small sample and noticed it somehow changed the date?
Add the -P option to preserve the original FileModifyDate.
- Phil
Sorry for my lack of knowledge. how to I "-p" for a directory of files?
capital "P", not lower case "p":
exiftool "-serialnumber<internalserialnumber" -P DIR
- Phil
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?
Check the Model tag. Possible something like:
exiftool -P -if "$Model eq 'DMC-GF2'" "-serialnumber<internalserialnumber" FilesOrDir
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?
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
-filename=DESTINATION_DIRECTORY/%f%-c.%e -P
what does the %f% - c.%e switch do?
%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.
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?
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 (https://exiftool.org/exiftool_pod.html) of exiftool with the suggested offset on one or two files and verify the information is correct and that the image is still editable.
I looked at the exif data for a few of the files and did not notice any errors in the data.
Quote from: BangkokPhoto on November 27, 2016, 06:32:23 PM
I looked at the exif data for a few of the files and did not notice any errors in the data.
Good, that means Exiftool correctly guessed the offset correction and that can fix them!
What should I be looking for? Maybe I simply do not know what to look for. There is a field in the few files I checked with exif field "Baby Name" and value was @@@@@@@@@@@@@@@@. I am unable to attach a TS2 photo to this thread for some reason.
ExifTool Version Number : 10.31
File Name : P1050259.JPG
Directory : C:/Users/ADMIN/Desktop
File Size : 3.1 MB
File Modification Date/Time : 2012:04:01 16:13:42+07:00
File Access Date/Time : 2016:11:30 01:42:50+07:00
File Creation Date/Time : 2016:11:30 01:42:50+07:00
File Permissions : rw-rw-rw-
File Type : JPEG
File Type Extension : jpg
MIME Type : image/jpeg
Exif Byte Order : Little-endian (Intel, II)
Make : Panasonic
Camera Model Name : DMC-TS2
Orientation : Horizontal (normal)
X Resolution : 180
Y Resolution : 180
Resolution Unit : inches
Software : ACD Systems Digital Imaging
Modify Date : 2012:04:01 16:13:40
Y Cb Cr Positioning : Co-sited
Exposure Time : 1/15
F Number : 5.4
Exposure Program : Program AE
ISO : 800
Exif Version : 0221
Date/Time Original : 2011:12:05 21:34:01
Create Date : 2011:12:05 21:34:01
Components Configuration : Y, Cb, Cr, -
Compressed Bits Per Pixel : 4
Exposure Compensation : 0
Max Aperture Value : 3.3
Metering Mode : Multi-segment
Light Source : Flash
Focal Length : 12.6 mm
Warning : [minor] Possibly incorrect maker notes offsets (fix by -406?)
Image Quality : High
Firmware Version : 0.1.1.0
White Balance : Auto
Focus Mode : Auto
AF Area Mode : Tracking
Image Stabilization : On, Mode 1
Macro Mode : Off
Shooting Mode : Night Scenery
Audio : No
Data Dump : (Binary data 8200 bytes, use -b option to extract)
White Balance Bias : 0
Flash Bias : 0
Internal Serial Number :
Panasonic Exif Version : 0300
Color Effect : Off
Time Since Power On : 00:00:10.08
Burst Mode : Off
Sequence Number : 0
Contrast Mode : Medium Low
Noise Reduction : Standard
Self Timer : Off
Rotation : Rotate 90 CW
AF Assist Lamp : Fired
Color Mode : Normal
Optical Zoom Mode : Standard
Conversion Lens : Off
Travel Day : n/a
World Time Location : Home
Program ISO : n/a
Advanced Scene Type : 5
Faces Detected : 0
AF Point Position : 1 48
Num Face Positions : 2
Face 1 Position : 4 0 14674 56
Face 2 Position : 2 7 4 0
Intelligent Exposure : Off
Faces Recognized : 0
Flash Warning : Yes (flash required but disabled)
Title : 2012:04:01 16:13:39
Baby Name :
Location : ..&...#/#&)*---.!141+4(,-+...........@+$+@@@@@@@@@@@@@@@@@@@@@@@
Intelligent Resolution : Standard
Maker Note Version : 0133
Scene Mode : Night Scenery
WB Red Level : 1241
WB Green Level : 1054
WB Blue Level : 2457
Flash Fired : Yes
Text Stamp : Off
Baby Age : @@@@@@@@@@@@@@@@@@@@
Transform : Off
Sub Sec Time : 239
Flashpix Version : 0100
Color Space : sRGB
Exif Image Width : 3240
Exif Image Height : 4320
Interoperability Index : R98 - DCF basic file (sRGB)
Interoperability Version : 0100
Sensing Method : One-chip color area
File Source : Digital Camera
Scene Type : Directly photographed
Custom Rendered : Normal
Exposure Mode : Auto
Digital Zoom Ratio : 0
Focal Length In 35mm Format : 71 mm
Scene Capture Type : Standard
Gain Control : High gain up
Contrast : Normal
Saturation : Normal
Sharpness : Normal
Compression : JPEG (old-style)
Thumbnail Offset : 10270
Thumbnail Length : 4598
XMP Toolkit : Public XMP Toolkit Core 3.5
Flash Return : No return detection
Flash Mode : Auto
Flash Function : False
Flash Red Eye Mode : False
Date/Time Digitized : 2011:12:05 21:34:01+7:00
Creator Tool : ACD Systems Digital Imaging
MPF Version : 0100
Number Of Images : 2
MP Image Flags : Dependent child image
MP Image Format : JPEG
MP Image Type : Large Thumbnail (full HD equivalent)
MP Image Length : 487475
MP Image Start : 3264393
Dependent Image 1 Entry Number : 0
Dependent Image 2 Entry Number : 0
Image Width : 3240
Image Height : 4320
Encoding Process : Baseline DCT, Huffman coding
Bits Per Sample : 8
Color Components : 3
Y Cb Cr Sub Sampling : YCbCr4:4:0 (1 2)
Advanced Scene Mode : Night Scenery (intelligent auto)
Aperture : 5.4
Blue Balance : 2.33112
Flash : Auto, Fired
Image Size : 3240x4320
Preview Image : (Binary data 487475 bytes, use -b option to extract)
Megapixels : 14.0
Red Balance : 1.177419
Scale Factor To 35 mm Equivalent: 5.6
Shutter Speed : 1/15
Modify Date : 2012:04:01 16:13:40.239
Thumbnail Image : (Binary data 4598 bytes, use -b option to extract)
Circle Of Confusion : 0.005 mm
Field Of View : 28.5 deg
Focal Length : 12.6 mm (35 mm equivalent: 71.0 mm)
Hyperfocal Distance : 5.51 m
Light Value : 5.8
-- press RETURN --
It is very likely that the image is too large to post here. You might try emailing it to me directly or use a file transfer service instead.
Your file does look corrupted though. The Baby Age and especially the Location look a bit screwed up, likely caused by your editing software. As I said the problem may be fixable by ExifTool, run exiftool -F -406 on a file and see if it fixes the location and baby age.
I am diligently trying to learn the command line switches and options in exiftool.
There are several dozen offset corrections recommended by exiftool.
How do I move all files with offset warnings to their own directory?
As far as software goes I have never owned anything from "ACD Systems Digital Imaging". The only software I have used is Adobe Lightroom ver3, 4, and now 6; and LR simply serves as a database/library.
I got your file and had a look at it. With the option -F 406 ExifTool indeed reads the file "better", that is it no longer show gibberish for some of the fields. Other changes are that it now shows an "Internal Serial Number" of "(F34) 2010:08:30 no. 0463", but it somehow loses other info (face positions) so I don't really know if that's an improvement. It could be that the face positions are in fact gibberish too, so it might still be best to add the fix base (-F) option:
$ exiftool -BabyName -BabyAge -Location P1050259.JPG
[MakerNotes:Panasonic] Baby Name :
[MakerNotes:Panasonic] Baby Age :
[MakerNotes:Panasonic] Baby Age : @@@@@@@@@@@@@@@@@@@@
[MakerNotes:Panasonic] Location : ..&...#/#&)*---.!141+4(,-+...........@+$+@@@@@@@@@@@@@@@@@@@@@@@
$ exiftool -F -BabyName -BabyAge -Location P1050259.JPG
[MakerNotes:Panasonic] Baby Name :
[MakerNotes:Panasonic] Baby Age : (not set)
[MakerNotes:Panasonic] Baby Age : (not set)
[MakerNotes:Panasonic] Location :
Note: you don't even have to specify -406; ExifTool takes a good guess at what it should be and uses that if you don't provide an offset yourself!
This won't fix it permanently though, for that you need to force exiftool to rewrite the file by e.g. changing one of the fields. You can do this non-destructive by setting one of the fields to itself e.g. like so: exiftool -F '-BabyName<${BabyName}' P1050259.JPG (this only works if the file has a tag called BabyName though, but you can basically replace BanyName with any tag you like).
Doing this does have ExifTool report an issue reading the PreviewImage from the file, but when I look at the image it's still OK, so it looks like the fix went well after all.
Regarding the software that altered your images (last), and likely screwed them up a bit, that was ACDSee, does that ring a bell?
This is all just Panasonic trash data. The TS2 did NOT have GPS so a location field is a mystery to me. I never took a photo of a Baby and Face Position is useless to me because it is useless to LR6.
In your professional/experienced opinion should I simply delete these "pointless" fields? The Internal Serial Number is hidden in these fields?
I do not recall using ACD. This was a long time ago; it's possible the camera came with bundled software, but I believe it was silkypix. This is a mystery to me. There are offset problems with other files showing Lightroom 3 and LR4 as the software.
I have been running Phil's command to create Serial Number field and populate it with "Internal Serial Number". I am 6 panasonic bodies into this fix and this is the only panasonic body with offset problems.
OK, if the fields I mentioned have no meaning to you and/or contain bogus info anyway (which is possible as the data was located wrongly), your best option is to run the "fix" command I suggested.
Note: the location and Baby tags are probably always present in files from your camera, they are not necessarily an indication of having e.g. a GPS (in which case you'd have seen GPS coordinates in the metadata).
Quote from: Hayo Baan on November 29, 2016, 02:52:43 PM
Other changes are that it now shows an "Internal Serial Number" of "(F34) 2010:08:30 no. 0463"
I tried to correct the offset but have not seen the "Internal Serial Number" appear. How did you do that?
With the sample file you sent to me earlier, I just performed the command I mentioned:
exiftool -F '-BabyName<${BabyName}' P1050259.JPG
This fixed the offset (permanently) and if you then run exiftool again, it will show you the internal serial number (at least it did for this file).
I don't have your file any longer so if you need me to show you the info I get again, you'll have to resend the file to me ;)
Cheers,
Hayo