Unable to read Nikon EXIF tags

Richard Rosenheim 86 Reputation points
2023-03-04T01:15:14.65+00:00

I've encountered a problem reading certain EXIF tags from Nikon cameras. I've tested images taken with couple different Canon cameras (no problems) and several Nikon cameras (D850, D5, D6, Z9). With the images from the various Nikon cameras, .NET (I'm using .NET Framework 4.8), is not returning the values for both the Artists (ie., Authors) (EXIF tag 0x013B) and the Copyright (EXIF tag 0x8298) tags.

I've tried using both the GetPropertyItem and the PropertyItems methods of an image of System.Drawing.Image type.

With GetPropertyItem, I get 'System.ArgumentException' being thrown by the System.Drawing.dll when I attempt to retrieve those fields, which is expected behavior when trying to retrieve an EXIF tag that doesn't exists.

With PropertyItems, those tags are not returned. And I've looked through the tags that PropertyItems do return to see if the information might be getting returned as a different tag. No such luck.

The information is being stored in the images. I've confirmed that both by looking at the hex dump of the image file, and also when I right-click on the image in Windows Explorer and do Properties, Details, the information is shown in the dialog box.

Does anyone have any ideas/solutions of how I can retrieve the information?

TIA,

Richard

Developer technologies | .NET | .NET Runtime
Developer technologies | .NET | Other
Developer technologies | VB
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.