Ejemplo n.º 1
0
        public virtual void OpenJpeg2()
        {
            // Test this a more specific entry point
            ImageData img = ImageDataFactory.CreateJpeg(UrlUtil.ToURL(sourceFolder + "WP_20140410_001_gray.jpg"));

            NUnit.Framework.Assert.AreEqual(2592, img.GetWidth(), 0);
            NUnit.Framework.Assert.AreEqual(1456, img.GetHeight(), 0);
            NUnit.Framework.Assert.AreEqual(8, img.GetBpc());
        }
Ejemplo n.º 2
0
 public virtual void AttemptToSetNullIccProfileToImageTest()
 {
     using (FileStream fis = new FileStream(SOURCE_FOLDER + "WP_20140410_001.jpg", FileMode.Open, FileAccess.Read
                                            )) {
         byte[][]  icc = new byte[][] { null, null };
         ImageData img = ImageDataFactory.CreateJpeg(StreamUtil.InputStreamToArray(fis));
         NUnit.Framework.Assert.DoesNotThrow(() => JpegImageHelper.AttemptToSetIccProfileToImage(icc, img));
     }
 }
Ejemplo n.º 3
0
 public virtual void OpenJpeg1()
 {
     using (FileStream fis = new FileStream(sourceFolder + "WP_20140410_001.jpg", FileMode.Open, FileAccess.Read
                                            )) {
         // Test this a more specific entry point
         ImageData img = ImageDataFactory.CreateJpeg(StreamUtil.InputStreamToArray(fis));
         NUnit.Framework.Assert.AreEqual(2592, img.GetWidth(), 0);
         NUnit.Framework.Assert.AreEqual(1456, img.GetHeight(), 0);
         NUnit.Framework.Assert.AreEqual(8, img.GetBpc());
     }
 }
Ejemplo n.º 4
0
 public virtual void AttemptToSetInvalidIccProfileToImageTest()
 {
     using (FileStream fis = new FileStream(SOURCE_FOLDER + "WP_20140410_001.jpg", FileMode.Open, FileAccess.Read
                                            )) {
         ImageData img  = ImageDataFactory.CreateJpeg(StreamUtil.InputStreamToArray(fis));
         int       size = 100;
         // Instantiate new byte[size][] instead new byte[size][size] necessary for autoporting
         byte[][] icc = new byte[size][];
         for (int i = 0; i < size; i++)
         {
             icc[i] = new byte[size];
             for (int j = 0; j < size; j++)
             {
                 icc[i][j] = (byte)j;
             }
         }
         NUnit.Framework.Assert.DoesNotThrow(() => JpegImageHelper.AttemptToSetIccProfileToImage(icc, img));
     }
 }