public virtual void SetUp()
 {
     System.Threading.Thread.CurrentThread.CurrentCulture = Sharpen.Extensions.CreateLocale("en", "GB");
     _nikonDirectory = ExifReaderTest.ProcessBytes<NikonType2MakernoteDirectory>("Tests/Data/nikonMakernoteType2a.jpg.app1");
     NUnit.Framework.Assert.IsNotNull(_nikonDirectory);
     _descriptor = new NikonType2MakernoteDescriptor(_nikonDirectory);
 }
 public NikonType2MakernoteTest1()
 {
     Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-GB");
     _nikonDirectory = ExifReaderTest.ProcessSegmentBytes<NikonType2MakernoteDirectory>("Tests/Data/nikonMakernoteType2a.jpg.app1");
     Assert.NotNull(_nikonDirectory);
     _descriptor = new NikonType2MakernoteDescriptor(_nikonDirectory);
 }
 public NikonType2MakernoteTest1()
 {
     Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo("en-GB");
     _nikonDirectory = ExifReaderTest.ProcessSegmentBytes <NikonType2MakernoteDirectory>("Tests/Data/nikonMakernoteType2a.jpg.app1");
     Assert.NotNull(_nikonDirectory);
     _descriptor = new NikonType2MakernoteDescriptor(_nikonDirectory);
 }
Exemplo n.º 4
0
 public virtual void SetUp()
 {
     System.Threading.Thread.CurrentThread.CurrentCulture = Sharpen.Extensions.CreateLocale("en", "GB");
     _nikonDirectory = ExifReaderTest.ProcessBytes <NikonType2MakernoteDirectory>("Tests/Data/nikonMakernoteType2a.jpg.app1");
     NUnit.Framework.Assert.IsNotNull(_nikonDirectory);
     _descriptor = new NikonType2MakernoteDescriptor(_nikonDirectory);
 }
 public virtual void TestGetAutoFlashCompensationDescription()
 {
     NikonType2MakernoteDirectory directory = new NikonType2MakernoteDirectory();
     NikonType2MakernoteDescriptor descriptor = new NikonType2MakernoteDescriptor(directory);
     // no entry exists
     NUnit.Framework.Assert.IsNull(descriptor.GetAutoFlashCompensationDescription());
     directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked((int)(0x06)), unchecked((int)(0x01)), unchecked((int)(0x06)) });
     Sharpen.Tests.AreEqual("1 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked((int)(0x04)), unchecked((int)(0x01)), unchecked((int)(0x06)) });
     Sharpen.Tests.AreEqual("0.67 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked((int)(0x02)), unchecked((int)(0x01)), unchecked((int)(0x06)) });
     Sharpen.Tests.AreEqual("0.33 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked((sbyte)0xFE), unchecked((int)(0x01)), unchecked((int)(0x06)) });
     Sharpen.Tests.AreEqual("-0.33 EV", descriptor.GetAutoFlashCompensationDescription());
 }
 public void TestGetAutoFlashCompensationDescription()
 {
     var directory = new NikonType2MakernoteDirectory();
     var descriptor = new NikonType2MakernoteDescriptor(directory);
     // no entry exists
     Assert.Null(descriptor.GetAutoFlashCompensationDescription());
     directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x06, 0x01, 0x06 });
     Assert.Equal("1 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x04, 0x01, 0x06 });
     Assert.Equal("0.67 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x02, 0x01, 0x06 });
     Assert.Equal("0.33 EV", descriptor.GetAutoFlashCompensationDescription());
     directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked((sbyte)0xFE), 0x01, 0x06 });
     Assert.Equal("-0.33 EV", descriptor.GetAutoFlashCompensationDescription());
 }
        public void TestGetAutoFlashCompensationDescription()
        {
            var directory  = new NikonType2MakernoteDirectory();
            var descriptor = new NikonType2MakernoteDescriptor(directory);

            // no entry exists
            Assert.Null(descriptor.GetAutoFlashCompensationDescription());
            directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x06, 0x01, 0x06 });
            Assert.Equal("1 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x04, 0x01, 0x06 });
            Assert.Equal("0.67 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { 0x02, 0x01, 0x06 });
            Assert.Equal("0.33 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.Set(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked ((sbyte)0xFE), 0x01, 0x06 });
            Assert.Equal("-0.33 EV", descriptor.GetAutoFlashCompensationDescription());
        }
        public virtual void TestGetAutoFlashCompensationDescription()
        {
            NikonType2MakernoteDirectory  directory  = new NikonType2MakernoteDirectory();
            NikonType2MakernoteDescriptor descriptor = new NikonType2MakernoteDescriptor(directory);

            // no entry exists
            NUnit.Framework.Assert.IsNull(descriptor.GetAutoFlashCompensationDescription());
            directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked ((int)(0x06)), unchecked ((int)(0x01)), unchecked ((int)(0x06)) });
            Sharpen.Tests.AreEqual("1 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked ((int)(0x04)), unchecked ((int)(0x01)), unchecked ((int)(0x06)) });
            Sharpen.Tests.AreEqual("0.67 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked ((int)(0x02)), unchecked ((int)(0x01)), unchecked ((int)(0x06)) });
            Sharpen.Tests.AreEqual("0.33 EV", descriptor.GetAutoFlashCompensationDescription());
            directory.SetByteArray(NikonType2MakernoteDirectory.TagAutoFlashCompensation, new sbyte[] { unchecked ((sbyte)unchecked ((int)(0xFE))), unchecked ((int)(0x01)), unchecked ((int)(0x06)) });
            Sharpen.Tests.AreEqual("-0.33 EV", descriptor.GetAutoFlashCompensationDescription());
        }
		public virtual void SetUp()
		{
			_nikonDirectory = ExifReaderTest.ProcessBytes<NikonType2MakernoteDirectory>("Tests/Data/nikonMakernoteType2a.jpg.app1");
			NUnit.Framework.Assert.IsNotNull(_nikonDirectory);
			_descriptor = new NikonType2MakernoteDescriptor(_nikonDirectory);
		}
Exemplo n.º 10
0
        public void NikonType2MakernoteTest1()
        {
            var directory = ExifReaderTest.ProcessSegmentBytes <NikonType2MakernoteDirectory>("Data/nikonMakernoteType2a.jpg.app1", JpegSegmentType.App1);

            Assert.NotNull(directory);

            /*
             *  [Nikon Makernote] Firmware Version = 0200
             *  [Nikon Makernote] ISO = 0 320
             *  [Nikon Makernote] File Format = FINE
             *  [Nikon Makernote] White Balance = FLASH
             *  [Nikon Makernote] Sharpening = AUTO
             *  [Nikon Makernote] AF Type = AF-C
             *  [Nikon Makernote] Unknown 17 = NORMAL
             *  [Nikon Makernote] Unknown 18 =
             *  [Nikon Makernote] White Balance Fine = 0
             *  [Nikon Makernote] Unknown 01 =
             *  [Nikon Makernote] Unknown 02 =
             *  [Nikon Makernote] Unknown 03 = 914
             *  [Nikon Makernote] Unknown 19 =
             *  [Nikon Makernote] ISO = 0 320
             *  [Nikon Makernote] Tone Compensation = AUTO
             *  [Nikon Makernote] Unknown 04 = 6
             *  [Nikon Makernote] Lens Focal/Max-FStop pairs = 240/10 850/10 35/10 45/10
             *  [Nikon Makernote] Unknown 05 = 0
             *  [Nikon Makernote] Unknown 06 = 
             *  [Nikon Makernote] Unknown 07 = 1
             *  [Nikon Makernote] Unknown 20 = 0
             *  [Nikon Makernote] Unknown 08 = @
             *  [Nikon Makernote] Colour Mode = MODE1
             *  [Nikon Makernote] Unknown 10 = NATURAL
             *  [Nikon Makernote] Unknown 11 = 0100
             *
             *  [Nikon Makernote] Camera Hue = 0
             *  [Nikon Makernote] Noise Reduction = OFF
             *  [Nikon Makernote] Unknown 12 = 0100
             *
             *  [Nikon Makernote] Unknown 13 = 0100{t@7b,4x,D"Y
             *  [Nikon Makernote] Unknown 15 = 78/10 78/10
             */

            Assert.Equal("48 50 48 48", directory.GetString(NikonType2MakernoteDirectory.TagFirmwareVersion));
            Assert.Equal("0 320", directory.GetString(NikonType2MakernoteDirectory.TagIso1));
            Assert.Equal("0 320", directory.GetString(NikonType2MakernoteDirectory.TagIsoRequested));
            Assert.Equal("FLASH       ", directory.GetString(NikonType2MakernoteDirectory.TagCameraWhiteBalance));
            Assert.Equal("AUTO  ", directory.GetString(NikonType2MakernoteDirectory.TagCameraSharpening));
            Assert.Equal("AF-C  ", directory.GetString(NikonType2MakernoteDirectory.TagAfType));
            Assert.Equal("NORMAL      ", directory.GetString(NikonType2MakernoteDirectory.TagFlashSyncMode));
            Assert.Equal("0", directory.GetString(NikonType2MakernoteDirectory.TagCameraWhiteBalanceFine));
            Assert.Equal("914", directory.GetString(NikonType2MakernoteDirectory.TagPreviewIfd));
            Assert.Equal("AUTO    ", directory.GetString(NikonType2MakernoteDirectory.TagCameraToneCompensation));
            Assert.Equal("6", directory.GetString(NikonType2MakernoteDirectory.TagLensType));
            Assert.Equal("240/10 850/10 35/10 45/10", directory.GetString(NikonType2MakernoteDirectory.TagLens));
            Assert.Equal("0", directory.GetString(NikonType2MakernoteDirectory.TagFlashUsed));
            Assert.Equal("1", directory.GetString(NikonType2MakernoteDirectory.TagShootingMode));
            Assert.Equal("0", directory.GetString(NikonType2MakernoteDirectory.TagUnknown20));
            Assert.Equal("MODE1   ", directory.GetString(NikonType2MakernoteDirectory.TagCameraColorMode));
            Assert.Equal("NATURAL    ", directory.GetString(NikonType2MakernoteDirectory.TagLightSource));
            Assert.Equal("0", directory.GetString(NikonType2MakernoteDirectory.TagCameraHueAdjustment));
            Assert.Equal("OFF ", directory.GetString(NikonType2MakernoteDirectory.TagNoiseReduction));
            Assert.Equal("78/10 78/10", directory.GetString(NikonType2MakernoteDirectory.TagSensorPixelSize));

            var descriptor = new NikonType2MakernoteDescriptor(directory);

            Assert.Equal("24-85mm f/3.5-4.5", descriptor.GetDescription(NikonType2MakernoteDirectory.TagLens));
            Assert.Equal("24-85mm f/3.5-4.5", descriptor.GetLensDescription());

            Assert.Equal("0 degrees", descriptor.GetDescription(NikonType2MakernoteDirectory.TagCameraHueAdjustment));
            Assert.Equal("0 degrees", descriptor.GetHueAdjustmentDescription());

            Assert.Equal("Mode I (sRGB)", descriptor.GetDescription(NikonType2MakernoteDirectory.TagCameraColorMode));
            Assert.Equal("Mode I (sRGB)", descriptor.GetColorModeDescription());
        }
 public virtual void SetUp()
 {
     _nikonDirectory = ExifReaderTest.ProcessBytes <NikonType2MakernoteDirectory>("Tests/Data/nikonMakernoteType2a.jpg.app1");
     NUnit.Framework.Assert.IsNotNull(_nikonDirectory);
     _descriptor = new NikonType2MakernoteDescriptor(_nikonDirectory);
 }