-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
First of all, thank you so much for providing the code example. As a newbie in C# I had a hard time trying to get the manufacturer information from image EXIF meta, and the code snippet provided here is a great starting point. However, this piece of code (checking manufacturer) seems to be working for images taken by iOS only. When I tested it on an image taken by OnePlus, it's not returning the string as expected. That's because the code currently has string manufacturer = encoding.GetString(propItems[1].Value);
. Manufacturer information does not always shows as the first item in the PropertyItems
list. It's associated with Id 271 though. So I think the code should be updated as string manufacturer = encoding.GetString(image.GetPropertyItem(271).Value);
. I was able to see the manufacturer string of OnePlus images correctly then.
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
- ID: 0bc83945-4821-c06f-850b-cb53066c4164
- Version Independent ID: eb79d9a0-ed56-3989-c7e5-b9ddeef04fbb
- Content: How to: Read Image Metadata
- Content Source: docs/framework/winforms/advanced/how-to-read-image-metadata.md
- Product: dotnet-framework
- GitHub Login: @dotnet-bot
- Microsoft Alias: dotnetcontent