Make Nikon sidecar (.nksc) files writable

Started by HarryEC123, August 03, 2023, 01:23:11 PM

Previous topic - Next topic

HarryEC123

Nikon stores edits in a sidecar file .nksc in the subdirectory NKSC_PARAM, so that the original file remains unchanged.
I want to be able to geotag my images using exiftool, which I can do with the command
exiftool -geotag garmin.gpx file.NEFWhich creates a backup of the original file, and writes to the RAW image. The disadvantage is that there are two files of 55MB, and Nikons's NK Studio doesn't recognize the geotagged image.
I tried the command to write to the sidecar file
exiftool -ext nef -geotag="garmin.gpx" -srcfile %d%f.%e.nksc /path/to/files/However, that created an error message that the file was not writable.

I've checked (with exiftool) older images of when Nikon software provided the geotagging feature was available, and the geotaging information is placed in the Nikon sidecar file.

Can the Nikon sidecar file be writtable please.

Phil Harvey

I'll repeat my comment from your other thread:

1. What version of ExifTool are you using?

2. Can you upload an NKSC file for testing?

- 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 ($).

HarryEC123

1) The latest version exiftool-12.64

2) Nikon sidecar file
DSC_5950.NEF.nksc

Alan Clifford

#3
After I have put location data into the .nef file with exiftool and saved it again using Nikon NX Studio, it creates a new .nksc and the location data is stored as xmp-ast.

(Incidentally, doing a similar save when the .nksc file already existing does not tranfer the location data over)

I've tried to delete one entry, [XMP:XMP-ast] Versionid I think but it's not writable.  I have been unable to use exiftool to write any location data to the .nksc file and the format of the data looks strange anyway.



[XMP:XMP-ast]   About                           : core-asteroid-tags
[XMP:XMP-ast]   Version                         : 11.0.0.3000
[XMP:XMP-ast]   XMLPackets                      : (Binary data 3582 bytes, use -b option to extract)
[XMP:XMP-ast]   XMLPacketsType                  : Binary
[XMP:XMP-ast]   IPTC                            : (Binary data 12 bytes, use -b option to extract)
[XMP:XMP-ast]   IPTCType                        : Binary
[XMP:XMP-ast]   GPSVersionID                    : 2.3.0.0
[XMP:XMP-ast]   GPSVersionIDType                : Binary
[XMP:XMP-ast]   GPSLatitudeRef                  : North
[XMP:XMP-ast]   GPSLatitudeRefType              : Long
[XMP:XMP-ast]   GPSLatitude                     : 37 deg 5' 32.30"
[XMP:XMP-ast]   GPSLatitudeType                 : Double
[XMP:XMP-ast]   GPSLongitudeRef                 : West
[XMP:XMP-ast]   GPSLongitudeRefType             : Long
[XMP:XMP-ast]   GPSLongitude                    : 3 deg 23' 10.69"
[XMP:XMP-ast]   GPSLongitudeType                : Double
[XMP:XMP-ast]   GPSAltitudeRef                  : Above Sea Level
[XMP:XMP-ast]   GPSAltitudeRefType              : Binary
[XMP:XMP-ast]   GPSAltitude                     : 2440.17333333333 m
[XMP:XMP-ast]   GPSAltitudeType                 : Double
[XMP:XMP-ast]   GPSTimeStamp                    : AAAAAAAAHEAAAAAAAABDQAAAAAAAgEVA
[XMP:XMP-ast]   GPSTimeStampType                : Double
[XMP:XMP-ast]   GPSDateStamp                    : 2023:07:11
[XMP:XMP-ast]   GPSDateStampType                : Ascii

Alan Clifford

cellini:NKSC_PARAM alan$  exiftool -config ../../nksc.config -xmp-ast:GPSlatitude=  DSC_5950.NEF.nksc

Warning: Sorry, xmp-ast:GPSLatitude is not writable
Nothing to do.

I was using exiftool version 12.60

Phil Harvey

The warning that Alan got makes sense:

Quote from: Alan Clifford on August 03, 2023, 03:57:23 PMWarning: Sorry, xmp-ast:GPSLatitude is not writable
Nothing to do.

This error (from HarryEC123 in the other thread) doesn't:

Quote from: HarryEC123 on August 01, 2023, 03:44:31 AMError: Writing of NKSC files is not yet supported - filename.NEF.nksc

Yes.  The XMP-ast tags are not yet writable.  Adding this ability would be a lot of work because Nikon is being really stupid about the formatting they are using.

- 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 ($).

Alan Clifford

Bit of a workaround

copy DSC_5950.NEF to temp_5950.NEF (use cp or windows equivalent NOT Nikon NX Studio)

add location data to temp_5950.NEF
exiftool  -geotag clark.gpx -geosync=-1:0:0 temp_5950.NEF

DSC_5950.NEF has an existing .nskc file, temp_5950.NEF does not

In NX Studio, choose temp_5950.NEF and click the image->metatdata->copy location data

Now choose DSC_5950.NEF and click image->metadata->paste location data

Location data is now in the .nksc file. Check with
exiftool -a -G0:1 -XMP-ast:*  NKSC_PARAM/DSC_5950.NEF.nksc