Beispiel #1
0
        public virtual void TestWindowsXpFields()
        {
            ExifIFD0Directory directory = ExifReaderTest.ProcessBytes <ExifIFD0Directory>("Tests/Data/windowsXpFields.jpg.app1");

            Sharpen.Tests.AreEqual("Testing artist\x0", directory.GetString(ExifIFD0Directory.TagWinAuthor, "UTF-16LE"));
            Sharpen.Tests.AreEqual("Testing comments\x0", directory.GetString(ExifIFD0Directory.TagWinComment, "UTF-16LE"));
            Sharpen.Tests.AreEqual("Testing keywords\x0", directory.GetString(ExifIFD0Directory.TagWinKeywords, "UTF-16LE"));
            Sharpen.Tests.AreEqual("Testing subject\x0", directory.GetString(ExifIFD0Directory.TagWinSubject, "UTF-16LE"));
            Sharpen.Tests.AreEqual("Testing title\x0", directory.GetString(ExifIFD0Directory.TagWinTitle, "UTF-16LE"));
            ExifIFD0Descriptor descriptor = new ExifIFD0Descriptor(directory);

            Sharpen.Tests.AreEqual("Testing artist", descriptor.GetDescription(ExifIFD0Directory.TagWinAuthor));
            Sharpen.Tests.AreEqual("Testing comments", descriptor.GetDescription(ExifIFD0Directory.TagWinComment));
            Sharpen.Tests.AreEqual("Testing keywords", descriptor.GetDescription(ExifIFD0Directory.TagWinKeywords));
            Sharpen.Tests.AreEqual("Testing subject", descriptor.GetDescription(ExifIFD0Directory.TagWinSubject));
            Sharpen.Tests.AreEqual("Testing title", descriptor.GetDescription(ExifIFD0Directory.TagWinTitle));
        }
Beispiel #2
0
        public virtual void TestYResolutionDescription()
        {
            ExifIFD0Directory directory = new ExifIFD0Directory();

            directory.SetRational(ExifIFD0Directory.TagYResolution, new Rational(50, 1));
            // 3 is for 'cm'
            directory.SetInt(ExifIFD0Directory.TagResolutionUnit, 3);
            ExifIFD0Descriptor descriptor = new ExifIFD0Descriptor(directory);

            Sharpen.Tests.AreEqual("50 dots per cm", descriptor.GetDescription(ExifIFD0Directory.TagYResolution));
        }
Beispiel #3
0
        public virtual void TestXResolutionDescription()
        {
            ExifIFD0Directory directory = new ExifIFD0Directory();

            directory.SetRational(ExifIFD0Directory.TagXResolution, new Rational(72, 1));
            // 2 is for 'Inch'
            directory.SetInt(ExifIFD0Directory.TagResolutionUnit, 2);
            ExifIFD0Descriptor descriptor = new ExifIFD0Descriptor(directory);

            Sharpen.Tests.AreEqual("72 dots per inch", descriptor.GetDescription(ExifIFD0Directory.TagXResolution));
        }