drewnoakes / metadata-extractor-dotnet

Extracts Exif, IPTC, XMP, ICC and other metadata from image, video and audio files
Other
926 stars 164 forks source link

Panasonic Lens on Panasonic Body - but where is the Lens Make/Model!? #296

Open Webreaper opened 3 years ago

Webreaper commented 3 years ago

Hi, this is really a question more than a bug. I have the attached image, which was taken on a Panasonic G9, with a Leica 100-400 lens. Exiftool can display the lens make and model (as a composite tag) but I'm blowed if I can find the tag when I run it through MetaDataExtractor... :)

My code looks like this:

                var subIfdDirectory = metadata.OfType<ExifSubIfdDirectory>().FirstOrDefault();

                if (subIfdDirectory != null)
                {
                    var lensMake = subIfdDirectory.SafeExifGetString(ExifDirectoryBase.TagLensMake);
                    var lensModel = subIfdDirectory.SafeExifGetString(ExifDirectoryBase.TagLensModel);
                    var lensSerial = subIfdDirectory.SafeExifGetString(ExifDirectoryBase.TagLensSerialNumber);

If I use the same lens on my Olympus EM5-Mk2, this pulls out the lens make and model. But on the G9 it doesn't - I'm presuming it's in some other tag? But I can't find it. Any hints on a) where it is, and b) how to easily find the tag in future? Is there a 'dump all' method for MetaDataExtractor which will give me the NVPs so I can grep? :)

_1022798

drewnoakes commented 3 years ago

If it's supported, it's likely to be in a Panasonic makernote directory. My advice would be to iterate through all tags in all directories and print them out. If you cannot find it, please post more details about the missing field, or even put together a pull request that adds support. It's likely just a new method in a descriptor class to look up a number in a table.

Webreaper commented 3 years ago

Thanks - good ideas. I added the tag dump, and sure enough it's there, under "Panasonic Makernote", with the tag "Lens Type".

I guess ExifTool has some extra logic that generates a composite tag for Lens Make/Model and pulls in the relevant info from various OEM Makertags. Does MetaDataExtractor have the same? If so, I'll have a rummage in the code and submit a PR so that this works with the generic 'Lens Make' and 'Lens Model' tags.

drewnoakes commented 3 years ago

I guess ExifTool has some extra logic that generates a composite tag for Lens Make/Model and pulls in the relevant info from various OEM Makertags. Does MetaDataExtractor have the same? If so, I'll have a rummage in the code and submit a PR so that this works with the generic 'Lens Make' and 'Lens Model' tags.

This sounds similar to #278 and https://github.com/drewnoakes/metadata-extractor/issues/10. We don't have anything like this yet. If you have ideas for a design here, let's discuss it on #278.

drewnoakes commented 3 years ago

@Webreaper are you happy to share your image with the project for regression testing purposes? We don't have an E5-Mk2 sample.

If so I'll add it to this repo: https://github.com/drewnoakes/metadata-extractor-images

Webreaper commented 3 years ago

The image attached above is from a Panasonic G9, with a Panasonic Leica 100-400 lens.

I can attach a sample OMD EM5 Mk2 image if that'll be useful for you. :)

Webreaper commented 3 years ago

Here's an OMD EM5 Mk2 image you can add to the DB. P3200002