public virtual void TestLoadJpegWithNoExifData()
 {
     sbyte[] badExifData = new sbyte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
     Com.Drew.Metadata.Metadata metadata = new Com.Drew.Metadata.Metadata();
     new ExifReader().Extract(badExifData, metadata, JpegSegmentType.App1);
     Sharpen.Tests.AreEqual(0, metadata.GetDirectoryCount());
 }
Exemplo n.º 2
0
 public virtual void TestStackOverflowOnRevisitationOfSameDirectory()
 {
     // An error has been discovered in Exif data segments where a directory is referenced
     // repeatedly.  Thanks to Alistair Dickie for providing the sample data used in this
     // unit test.
     Com.Drew.Metadata.Metadata metadata = ProcessBytes("Tests/Data/recursiveDirectories.jpg.app1");
     // Mostly we're just happy at this point that we didn't get stuck in an infinite loop.
     Sharpen.Tests.AreEqual(5, metadata.GetDirectoryCount());
 }
Exemplo n.º 3
0
        public virtual void TestReadJpegSegmentWithNoExifData()
        {
            sbyte[] badExifData = new sbyte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
            Com.Drew.Metadata.Metadata metadata = new Com.Drew.Metadata.Metadata();
            AList <sbyte[]>            segments = new AList <sbyte[]>();

            segments.Add(badExifData);
            new ExifReader().ReadJpegSegments(segments.AsIterable(), metadata, JpegSegmentType.App1);
            Sharpen.Tests.AreEqual(0, metadata.GetDirectoryCount());
            Sharpen.Tests.IsFalse(metadata.HasErrors());
        }