public virtual void TestExifDirectory_MatchesKnownValues()
 {
     Sharpen.Tests.AreEqual("          ", _exifIFD0Directory.GetString(ExifIFD0Directory.TagImageDescription));
     Sharpen.Tests.AreEqual("NIKON", _exifIFD0Directory.GetString(ExifIFD0Directory.TagMake));
     Sharpen.Tests.AreEqual("E995", _exifIFD0Directory.GetString(ExifIFD0Directory.TagModel));
     Sharpen.Tests.AreEqual(300, _exifIFD0Directory.GetDouble(ExifIFD0Directory.TagXResolution), 0.001);
     Sharpen.Tests.AreEqual(300, _exifIFD0Directory.GetDouble(ExifIFD0Directory.TagYResolution), 0.001);
     Sharpen.Tests.AreEqual(2, _exifIFD0Directory.GetInt(ExifIFD0Directory.TagResolutionUnit));
     Sharpen.Tests.AreEqual("E995v1.6", _exifIFD0Directory.GetString(ExifIFD0Directory.TagSoftware));
     Sharpen.Tests.AreEqual("2002:08:29 17:31:40", _exifIFD0Directory.GetString(ExifIFD0Directory.TagDatetime));
     Sharpen.Tests.AreEqual(1, _exifIFD0Directory.GetInt(ExifIFD0Directory.TagYcbcrPositioning));
     Sharpen.Tests.AreEqual(new Rational(2439024, 100000000), _exifSubIFDDirectory.GetRational(ExifSubIFDDirectory.TagExposureTime));
     Sharpen.Tests.AreEqual(2.6, _exifSubIFDDirectory.GetDouble(ExifSubIFDDirectory.TagFnumber), 0.001);
     Sharpen.Tests.AreEqual(2, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagExposureProgram));
     Sharpen.Tests.AreEqual(100, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagIsoEquivalent));
     Sharpen.Tests.AreEqual("48 50 49 48", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagExifVersion));
     Sharpen.Tests.AreEqual("2002:08:29 17:31:40", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagDatetimeDigitized));
     Sharpen.Tests.AreEqual("2002:08:29 17:31:40", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagDatetimeOriginal));
     Sharpen.Tests.AreEqual("1 2 3 0", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagComponentsConfiguration));
     Sharpen.Tests.AreEqual(0, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagExposureBias));
     Sharpen.Tests.AreEqual("0", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagMaxAperture));
     Sharpen.Tests.AreEqual(5, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagMeteringMode));
     Sharpen.Tests.AreEqual(0, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagWhiteBalance));
     Sharpen.Tests.AreEqual(1, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagFlash));
     Sharpen.Tests.AreEqual(8.2, _exifSubIFDDirectory.GetDouble(ExifSubIFDDirectory.TagFocalLength), 0.001);
     Sharpen.Tests.AreEqual("0 0 0 0 0 0 0 0 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32"
                            , _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagUserComment));
     Sharpen.Tests.AreEqual("48 49 48 48", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagFlashpixVersion));
     Sharpen.Tests.AreEqual(1, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagColorSpace));
     Sharpen.Tests.AreEqual(2048, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagExifImageWidth));
     Sharpen.Tests.AreEqual(1536, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagExifImageHeight));
     Sharpen.Tests.AreEqual(3, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagFileSource));
     Sharpen.Tests.AreEqual(1, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagSceneType));
 }
예제 #2
0
 public virtual void TestExifDirectory_MatchesKnownValues()
 {
     Sharpen.Tests.AreEqual("          ", _exifIFD0Directory.GetString(ExifIFD0Directory.TagImageDescription));
     Sharpen.Tests.AreEqual("NIKON", _exifIFD0Directory.GetString(ExifIFD0Directory.TagMake));
     Sharpen.Tests.AreEqual("E950", _exifIFD0Directory.GetString(ExifIFD0Directory.TagModel));
     Sharpen.Tests.AreEqual(1, _exifIFD0Directory.GetInt(ExifIFD0Directory.TagOrientation));
     Sharpen.Tests.AreEqual(300, _exifIFD0Directory.GetDouble(ExifIFD0Directory.TagXResolution), 0.001);
     Sharpen.Tests.AreEqual(300, _exifIFD0Directory.GetDouble(ExifIFD0Directory.TagYResolution), 0.001);
     Sharpen.Tests.AreEqual(2, _exifIFD0Directory.GetInt(ExifIFD0Directory.TagResolutionUnit));
     Sharpen.Tests.AreEqual("v981-79", _exifIFD0Directory.GetString(ExifIFD0Directory.TagSoftware));
     Sharpen.Tests.AreEqual("2001:04:06 11:51:40", _exifIFD0Directory.GetString(ExifIFD0Directory.TagDatetime));
     Sharpen.Tests.AreEqual(2, _exifIFD0Directory.GetInt(ExifIFD0Directory.TagYcbcrPositioning));
     Sharpen.Tests.AreEqual(new Rational(1, 77), _exifSubIFDDirectory.GetRational(ExifSubIFDDirectory.TagExposureTime));
     Sharpen.Tests.AreEqual(5.5, _exifSubIFDDirectory.GetDouble(ExifSubIFDDirectory.TagFnumber), 0.001);
     Sharpen.Tests.AreEqual(2, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagExposureProgram));
     Sharpen.Tests.AreEqual(80, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagIsoEquivalent));
     Sharpen.Tests.AreEqual("48 50 49 48", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagExifVersion));
     Sharpen.Tests.AreEqual("2001:04:06 11:51:40", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagDatetimeDigitized));
     Sharpen.Tests.AreEqual("2001:04:06 11:51:40", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagDatetimeOriginal));
     Sharpen.Tests.AreEqual("1 2 3 0", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagComponentsConfiguration));
     Sharpen.Tests.AreEqual(4, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagCompressedAverageBitsPerPixel));
     Sharpen.Tests.AreEqual(0, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagExposureBias));
     // this 2.6 *apex*, which is F2.5
     Sharpen.Tests.AreEqual(2.6, _exifSubIFDDirectory.GetDouble(ExifSubIFDDirectory.TagMaxAperture), 0.001);
     Sharpen.Tests.AreEqual(5, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagMeteringMode));
     Sharpen.Tests.AreEqual(0, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagWhiteBalance));
     Sharpen.Tests.AreEqual(0, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagFlash));
     Sharpen.Tests.AreEqual(12.8, _exifSubIFDDirectory.GetDouble(ExifSubIFDDirectory.TagFocalLength), 0.001);
     Sharpen.Tests.AreEqual("0 0 0 0 0 0 0 0 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32 32"
                            , _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagUserComment));
     Sharpen.Tests.AreEqual("48 49 48 48", _exifSubIFDDirectory.GetString(ExifSubIFDDirectory.TagFlashpixVersion));
     Sharpen.Tests.AreEqual(1, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagColorSpace));
     Sharpen.Tests.AreEqual(1600, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagExifImageWidth));
     Sharpen.Tests.AreEqual(1200, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagExifImageHeight));
     Sharpen.Tests.AreEqual(3, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagFileSource));
     Sharpen.Tests.AreEqual(1, _exifSubIFDDirectory.GetInt(ExifSubIFDDirectory.TagSceneType));
     Sharpen.Tests.AreEqual(6, _thumbDirectory.GetInt(ExifThumbnailDirectory.TagThumbnailCompression));
     Sharpen.Tests.AreEqual(2036, _thumbDirectory.GetInt(ExifThumbnailDirectory.TagThumbnailOffset));
     Sharpen.Tests.AreEqual(4662, _thumbDirectory.GetInt(ExifThumbnailDirectory.TagThumbnailLength));
 }