Metadata For resolution of DNG files

Anyone have any ideas on getting the resolution of DNG (Adobe Digital Negative Format) files?

Picresx works fine for JPG TIFF etc, but does not seem to work for DNG. Photoshop just tags it as Resolution.

Any help much appreciated.

Photo viewers XnViewMP and PicMeta will provide this info. For use within Opus I'd pick ExifTool.

Thanks for the tip. Exif Tool unsurprisingly reports the metadata field is X Resolution, just s JPEG, TIFF etc. so the next question is why:

Set imageData = selItem.Metadata.image
Set otherData = selitem.Metadata.other
dippy = imagedata.picresx

yields a zero value with DNG format files in Opus and the correct value in JPEG TIFF etc?

Raw picture formats are simply not as well supported as jpg, tiff etc.

Extended EXIF might help or at least give you some ideas how to use Exiftool in your script.

Many thanks for your suggestion. But I have hit on a different and simpler solution. As the DNG files I have are all imported from Lightroom, I do, in fact know their dpi.

But because my script was being confronted by a 0 length field, the script was erroring. A simple If loop to apply to DNG files has sorted it out.

Problem solved, thanks for your help with another example of the mess that is image metadata

If you add the resolution columns to the file display do they show anything for those files? I have some sample DNG files here which show X and Y resolution fine so I would have expected a script to be able to read them as well.

The x and resolutions only show up for for JPEG images. They are blank for DNG files.

The DNG files I am using are all imported from my Nikon D600 into Lightroom and then exported out.

I have seen a couple of reports that the problem may be caused by using Lightroom Metadata presets. I use one of these presets, but deleting this does not help.

Dalesman (5 of 25).zip (30.0 MB)

I attach one of my DNG files with the problem

Thanks, I'll have a look. The samples I was looking at came from if you want to compare them.

The images from the kenrockwell site have x and y resolution set and my macro code picks them up OK.