Exemplo n.º 1
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));
     }
 }
Exemplo n.º 2
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));
     }
 }