这里定义的Photoes,对我来说就是BMP, JPG, TIF, 和CR2 (Canon RAW)。至于NEF之类的,暂不在我考虑范围。

首先是EXIF信息。具体Specification参见:http://www.exif.org/specifications.html,可以下载EXIF 2.2标准的PDF。.NET中对应的Image属于System.Drawing namespace。具体的EXIF可以从PropertyItem中读取。

Label Shell Key Hex value Dec Value Format ID Type Other
Aperture PKEY_Photo_Aperture 9202 37378 14B81DA1-0135-4D31-96D9-6CBFC9671A99 Double  
  PKEY_Photo_ApertureDenominator 64 100 E1A9A38B-6685-46BD-875E-570DC7AD7320 UInt32  
  PKEY_Photo_ApertureNumerator 64 100 0337ECEC-39FB-4581-A0BD-4C4CC51E9914 UInt32  
Brightness PKEY_Photo_Brightness 64 100 1A701BF6-478C-4361-83AB-3701BB053C58 UInt32  
  PKEY_Photo_BrightnessDenominator 64 100 6EBE6946-2321-440A-90F0-C043EFD32476 UInt32  
  PKEY_Photo_BrightnessNumerator 64 100 9E7D118F-B314-45A0-8CFB-D654B917C9E9 UInt32  
Camera maker PKEY_Photo_CameraManufacturer 10F 271 14B81DA1-0135-4D31-96D9-6CBFC9671A99 String  
PKEY_Photo_CameraModel PKEY_Photo_CameraModel 110 272 14B81DA1-0135-4D31-96D9-6CBFC9671A99 String  
Camera serial number PKEY_Photo_CameraSerialNumber 111 273 14B81DA1-0135-4D31-96D9-6CBFC9671A99 String  
Contrast PKEY_Photo_Contrast 64 100 2A785BA9-8D23-4DED-82E6-60A350C86A10 UInt32  
  PKEY_Photo_ContrastText 64 100 59DDE9F2-5253-40EA-9A8B-479E96C6249A String  
Date Taken PKEY_Photo_DateTaken 9003 36867 14B81DA1-0135-4D31-96D9-6CBFC9671A99 DateTime  
Digital zoom PKEY_Photo_DigitalZoom   100 F85BF840-A925-4BC2-B0C4-8E36B598679E Double  
  PKEY_Photo_DigitalZoomDenominator 64 100 745BAF0E-E5C1-4CFB-8A1B-D031A0A52393 UInt32  
  PKEY_Photo_DigitalZoomNumerator 64 100 16CBB924-6500-473B-A5BE-F1599BCBE413 UInt32  
Event PKEY_Photo_Event 4748 18248 14B81DA1-0135-4D31-96D9-6CBFC9671A99 String  
EXIF Version PKEY_Photo_EXIFVersion   100 D35F743A-EB2E-47F2-A286-844132CB1427 String  
Exposure bias PKEY_Photo_ExposureBias 9204 37380 14B81DA1-0135-4D31-96D9-6CBFC9671A99 Double  
  PKEY_Photo_ExposureBiasDenominator   100 AB205E50-04B7-461C-A18C-2F233836E627 Int32  
  PKEY_Photo_ExposureBiasNumerator   100 738BF284-1D87-420B-92CF-5834BF6EF9ED7 Int32  
Exposure index PKEY_Photo_ExposureIndex   100 967B5AF8-995A-46ED-9E11-35B3C5B9782D Double  
  PKEY_Photo_ExposureIndexDenominator   100 93112F89-C28B-492F-8A9D-4BE2062CEE8A UInt32  
  PKEY_Photo_ExposureIndexNumerator   100 CDEDCF30-8919-44DF-8F4C-4EB2FFDB8D89 UInt32  
Exposure program PKEY_Photo_ExposureProgram 8822 34850 14B81DA1-0135-4D31-96D9-6CBFC9671A99 UInt32  
  PKEY_Photo_ExposureProgramText   100 FEC690B7-5F30-4646-AE47-4CAAFBA884A3 String  
Exposure time PKEY_Photo_ExposureTime 829A 33434 14B81DA1-0135-4D31-96D9-6CBFC9671A99 Double 30; 15; 8; 4; 2; 1; 1/2; 1/4; 1/8; 1/15; 1/30; 1/60; 1/125; 1/250; 1/500; 1/1000; 1/2000
  PKEY_Photo_ExposureTimeDenominator   100 55E98597-AD16-42E0-B624-21599A199838 UInt32  
  PKEY_Photo_ExposureTimeNumerator   100 257E44E2-9031-4323-AC38-85C552871B2E UInt32  
Flash mode PKEY_Photo_Flash 9209 37385 14B81DA1-0135-4D31-96D9-6CBFC9671A99 Byte  
Flash energy PKEY_Photo_FlashEnergy A20B 41483 14B81DA1-0135-4D31-96D9-6CBFC9671A99 Double  
  PKEY_Photo_FlashEnergyDenominator   100 D7B61C70-6323-49CD-A5FC-C84277162C97 UInt32  
  PKEY_Photo_FlashEnergyNumerator   100 FCAD3D3D-0858-400F-AAA3-2F66CCE2A6BC UInt32  
Flash maker PKEY_Photo_FlashManufacturer   100 AABAF6C9-E0C5-4719-8585-57B103E584FE String  
Flash model PKEY_Photo_FlashModel   100 FE83BB35-4D1A-42E2-916B-06F3E1AF719E String  
  PKEY_Photo_FlashText   100 6B8B68F6-200B-47EA-8D25-D8050F57339F String  
F-stop PKEY_Photo_Fnumber 829D 33437 14B81DA1-0135-4D31-96D9-6CBFC9671A99 Double 1; 1.4; 2; 2.8; 4; 5.6; 8; 11; 16; 22; 32
  PKEY_Photo_FNumberDenominator   100 E92A2496-223B-4463-A4E3-30EABBA79D80 UInt32  
  PKEY_Photo_FNumberNumerator   100 1B97738A-FDFC-462F-9D93-1957E08BE90C UInt32  
Focal length PKEY_Photo_FocalLength 920A 37386 A1-01314B81D5-4D31-96D9-6CBFC9671A99 Double  
  PKEY_Photo_FocalLengthDenominator   100 305BC615-DCA1-44A5-9FD4-10C0BA79412E UInt32  
35mm focal length PKEY_Photo_FocalLengthInFilm   100 A0E74609-B84D-4F49-B860-462BD9971F98 UInt16  
  PKEY_Photo_FocalLengthNumerator   100 776B6B3B-1E3D-4B0C-9A0E-8FBAF2A8492A UInt32  
Focal plane X resolution PKEY_Photo_FocalPlaneXResolution   100 CFC08D97-C6F7-4484-89DD-EBEF4356FE76 Double  
  PKEY_Photo_FocalPlaneXResolutionDenominator   100 0933F3F5-4786-4F46-A8E8-D64DD37FA521 UInt32  
  PKEY_Photo_FocalPlaneXResolutionNumerator   100 DCCB10AF-B4E2-4B88-95F9-031B4D5AB490 UInt32  
Focal plane Y resolution PKEY_Photo_FocalPlaneYResolution   100 4FFFE4D0-914F-4AC4-8D6F-C9C61DE169B1 Double  
  PKEY_Photo_FocalPlaneYResolutionDenominator   100 1D6179A6-A876-4031-B013-3347B2B64DC8 UInt32  
  PKEY_Photo_FocalPlaneYResolutionNumerator   100 A2E541C5-4440-4BA8-867E-75CFC06828CD UInt32  
Gain control PKEY_Photo_GainControl   100 FA304789-00C7-4D80-904A-1E4DCC7265AA Double  
  PKEY_Photo_GainControlDenominator   100 42864DFD-9DA4-4F77-BDED-4AAD7B256735 UInt32  
  PKEY_Photo_GainControlNumerator   100 8E8ECF7C-B7B8-4EB8-A63F-0EE715C96F9E UInt32  
  PKEY_Photo_GainControlText   100 C06238B2-0BF9-4279-A723-25856715CB9D String  
ISO speed PKEY_Photo_ISOSpeed 8827 34855 14B81DA1-0135-4D31-96D9-6CBFC9671A99 UInt16  
Lens maker PKEY_Photo_LensManufacturer   100 E6DDCAF7-29C5-4F0A-9A68-D19412EC7090 String  
  PKEY_Photo_LensModel   100 E1277516-2B5F-4869-89B1-2E585BD38B7A String  
Light source PKEY_Photo_LightSource 9208 37384 14B81DA1-0135-4D31-96D9-6CBFC9671A99 UInt32  
  PKEY_Photo_MakerNote   100 FA303353-B659-4052-85E9-BCAC79549B84 Buffer  
  PKEY_Photo_MakerNoteOffset   100 813F4124-34E6-4D17-AB3E-6B1F3C2247A1 UInt64  
Max aperture PKEY_Photo_MaxAperture   100 08F6D7C2-E3F2-44FC-AF1E-5AA5C81A2D3E Double  
  PKEY_Photo_MaxApertureDenominator   100 C77724D4-601F-46C5-9B89-C53F93BCEB77 UInt32  
  PKEY_Photo_MaxApertureNumerator   100 C107E191-A459-44C5-9AE6-B952AD4B906D UInt32  
Metering mode PKEY_Photo_MeteringMode 9207 37383 14B81DA1-0135-4D31-96D9-6CBFC9671A99 UInt16  
  PKEY_Photo_MeteringModeText   100 F628FD8C-7BA8-465A-A65B-C5AA79263A9E String  
Orientation PKEY_Photo_Orientation 112 274 14B81DA1-0135-4D31-96D9-6CBFC9671A99 UInt16  
  PKEY_Photo_OrientationText   100 A9EA193C-C511-498A-A06B-58E2776DCC28 String  
People PKEY_Photo_PeopleNames   100 E8309B6E-084C-49B4-B1FC-90A80331B638 String  
Photometric intrepretation PKEY_Photo_PhotometricInterpretation   100 341796F1-1DF9-4B1C-A564-91BDEFA43877 UInt16  
  PKEY_Photo_PhotometricInterpretationText   100 821437D6-9EAB-4765-A589-3B1CBBD22A61 String  
Program mode PKEY_Photo_ProgramMode   100 6D217F6D-3F6A-4825-B470-5F03CA2FBE9B UInt32  
  PKEY_Photo_ProgramModeText   100 7FE3AA27-2648-42F3-89B0-454E5CB150C3 String  
Audio PKEY_Photo_RelatedSoundFile   100 318A6B45-087F-4DC2-B8CC-05359551FC9E String  
Saturation PKEY_Photo_Saturation   100 49237325-A95A-4F67-B211-816B2D45D2E0 UInt32  
  PKEY_Photo_SaturationText   100 61478C08-B600-4A84-BBE4-E99C45F0A072 String  
Sharpness PKEY_Photo_Sharpness   100 FC6976DB-8349-4970-AE97-B3C5316A08F0 UInt32  
  PKEY_Photo_SharpnessText   100 51EC3F47-DD50-421D-8769-334F50424B1E String  
Shutter speed PKEY_Photo_ShutterSpeed 9201 37377 14B81DA1-0135-4D31-96D9-6CBFC9671A99 Double  
  PKEY_Photo_ShutterSpeedDenominator   100 E13D8975-81C7-4948-AE3F-37CAE11E8FF7 Int32  
  PKEY_Photo_ShutterSpeedNumerator   100 16EA4042-D6F4-4BCA-8349-7C78D30FB333 Int32  
Subject distance PKEY_Photo_SubjectDistance 9206 37382 14B81DA1-0135-4D31-96D9-6CBFC9671A99 Double  
  PKEY_Photo_SubjectDistanceDenominator   100 0C840A88-B043-466D-9766-D4B26DA3FA77 UInt32  
  PKEY_Photo_SubjectDistanceNumerator   100 8AF4961C-F526-43E5-AA81-DB768219178D UInt32  
Tag view PKEY_Photo_TagViewAggregate   100 B812F15D-C2D8-4BBF-BACD-79744346113F String  
  PKEY_Photo_TranscodedForSync   100 9A8EBB75-6458-4E82-BACB-35C0095B03BB Boolean  
White balance PKEY_Photo_WhiteBalance   100 EE3D3D8A-5381-4CFA-B13B-AAF66B5F4EC9 UInt32  
  PKEY_Photo_WhiteBalanceText   100 6336B95E-C7A7-426D-86FD-7AE3D39C84B4 String  

这里解决不了的一个问题是,读取Lens信息

而Photoshop却可以完美的解决问题:

013

核心的问题是在XMP,看看其核心定义:http://www.adobe.com/products/xmp/index.html

比如Lens信息显示在Photoshop的Photo Info对话框。

014

而Microsoft提供了一个WIC http://www.microsoft.com/downloads/details.aspx?FamilyID=8e011506-6307-445b-b950-215def45ddd8&displaylang=en 来解决这个问题。MSDN中的WIC根节点:http://msdn.microsoft.com/en-us/library/ee719902(VS.85).aspx。.NET中对应的Namespace: System.Windows.Media.Imaging。

By Alva Chien 2010.04.15