スキップしてメイン コンテンツに移動

投稿

ラベル(Property Item)が付いた投稿を表示しています

C#: How to Read Image MetaData from System.Drawing.Imaging.PropertyItem

I have written simple debug code for printing out PropertyItems in System.Drawing.Image object. The key part of the code: mapping between Id property of PropertyItem and description of associated to the property item. decode PropertyItem value (byte array) to human readable format string The code itself will be shown at the bottom of this post. Below is a sample image which will be passed to the program and the corresponding output generated by the program. Property Item 1 Id: 0x10e Type: 2 Length: 17 bytes Type String: ASCII Descriotion: PropertyTagImageDescription Value : MetaData Example Property Item 2 Id: 0x131 Type: 2 Length: 7 bytes Type String: ASCII Descriotion: PropertyTagSoftwareUsed Value : Picasa Property Item 3 Id: 0x9000 Type: 7 Length: 4 bytes Type String: Undefined Descriotion: PropertyTagExifVer Value : Property Item 4 Id: 0xa002 Type: 4 Length: 4 bytes Type String: Long (3