public virtual void OpenTiff3() { ImageData img = ImageDataFactory.Create(sourceFolder + "WP_20140410_001_monochrome.tiff"); NUnit.Framework.Assert.AreEqual(2592, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(1456, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); }
public virtual void OpenJpeg6() { ImageData img = ImageDataFactory.Create(SOURCE_FOLDER + "WP_20140410_001_year1980.jpg"); NUnit.Framework.Assert.AreEqual(2592, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(1456, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); }
public virtual void OpenJpeg4() { ImageData img = ImageDataFactory.Create(sourceFolder + "WP_20140410_001_negate.jpg"); NUnit.Framework.Assert.AreEqual(2592, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(1456, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); }
public virtual void OpenJpeg2000_2() { ImageData img = ImageDataFactory.Create(sourceFolder + "WP_20140410_001.JPC"); Jpeg2000ImageHelper.ProcessImage(img); NUnit.Framework.Assert.AreEqual(2592, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(1456, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); }
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()); }
public virtual void OpenTiff2() { // Test a more specific entry point ImageData img = ImageDataFactory.CreateTiff(UrlUtil.ToURL(sourceFolder + "WP_20140410_001_gray.tiff"), false , 1, false); NUnit.Framework.Assert.AreEqual(2592, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(1456, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); }
public virtual void Graya8BpcAddColorToAlphaImageTest() { ImageData img = ImageDataFactory.Create(sourceFolder + "graya8BpcAddColorToAlpha.png"); NUnit.Framework.Assert.AreEqual(ImageType.PNG, img.GetOriginalType()); NUnit.Framework.Assert.AreEqual(100, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(100, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); NUnit.Framework.Assert.AreEqual(1, img.GetColorSpace()); }
public virtual void Rgb8BpcDepthImageTest() { ImageData img = ImageDataFactory.Create(sourceFolder + "rgb8Bpc.png"); NUnit.Framework.Assert.AreEqual(ImageType.PNG, img.GetOriginalType()); NUnit.Framework.Assert.AreEqual(100, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(100, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); NUnit.Framework.Assert.AreEqual(3, img.GetColorSpace()); }
public virtual void OpenTiff1() { byte[] imageBytes = StreamUtil.InputStreamToArray(new FileStream(sourceFolder + "WP_20140410_001.tif", FileMode.Open , FileAccess.Read)); // Test a more specific entry point ImageData img = ImageDataFactory.CreateTiff(imageBytes, false, 1, false); NUnit.Framework.Assert.AreEqual(2592, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(1456, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); }
public virtual void OpenJpeg3() { using (FileStream fis = new FileStream(sourceFolder + "WP_20140410_001_monochrome.jpg", FileMode.Open, FileAccess.Read )) { // Test this a more specific entry point ImageData img = ImageDataFactory.Create(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()); } }
public virtual void Grayscale16BpcDepthImageTest() { // iText explicitly processes 16bit images as 8bit ImageData img = ImageDataFactory.Create(sourceFolder + "grayscale16Bpc.png"); NUnit.Framework.Assert.AreEqual(ImageType.PNG, img.GetOriginalType()); NUnit.Framework.Assert.AreEqual(100, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(100, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); NUnit.Framework.Assert.AreEqual(1, img.GetColorSpace()); NUnit.Framework.Assert.AreEqual(0, ((PngImageData)img).GetColorType()); }
public virtual void Indexed2BpcWithAlphaChannelTest() { ImageData img = ImageDataFactory.Create(sourceFolder + "indexed2BpcWithAlphaChannel.png"); NUnit.Framework.Assert.AreEqual(ImageType.PNG, img.GetOriginalType()); NUnit.Framework.Assert.AreEqual(346, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(49, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(2, img.GetBpc()); //Indexed colorspace contains one component indeed NUnit.Framework.Assert.AreEqual(1, img.GetColorSpace()); NUnit.Framework.Assert.AreEqual(3, ((PngImageData)img).GetColorType()); }
public virtual void RgbWithoutSaveColorProfileImageTest() { ImageData img = ImageDataFactory.Create(sourceFolder + "rgbWithoutSaveColorProfile.png"); NUnit.Framework.Assert.AreEqual(ImageType.PNG, img.GetOriginalType()); NUnit.Framework.Assert.AreEqual(100, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(100, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); NUnit.Framework.Assert.AreEqual(3, img.GetColorSpace()); NUnit.Framework.Assert.AreEqual(2, ((PngImageData)img).GetColorType()); NUnit.Framework.Assert.IsNull(img.GetProfile()); }
public virtual void OpenBmp3() { String imageFileName = sourceFolder + "WP_20140410_001_monochrome.bmp"; using (FileStream fis = new FileStream(imageFileName, FileMode.Open, FileAccess.Read)) { byte[] imageBytes = StreamUtil.InputStreamToArray(fis); // Test this a more specific entry point ImageData img = ImageDataFactory.CreateBmp(imageBytes, false); NUnit.Framework.Assert.AreEqual(2592, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(1456, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(1, img.GetBpc()); } }
public virtual void GrayscaleSimpleTransparencyImageTest() { ImageData img = ImageDataFactory.Create(sourceFolder + "grayscaleSimpleTransparencyImage.png"); NUnit.Framework.Assert.AreEqual(ImageType.PNG, img.GetOriginalType()); NUnit.Framework.Assert.AreEqual(200, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(200, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); NUnit.Framework.Assert.AreEqual(1, img.GetColorSpace()); NUnit.Framework.Assert.AreEqual(0, ((PngImageData)img).GetColorType()); NUnit.Framework.Assert.IsNotNull(img.GetImageAttributes()); NUnit.Framework.Assert.AreEqual("[0 0]", img.GetImageAttributes().Get(PngImageHelperConstants.MASK)); }
public virtual void Graya8BpcDepthImageTest() { ImageData img = ImageDataFactory.Create(sourceFolder + "graya8Bpc.png"); NUnit.Framework.Assert.AreEqual(ImageType.PNG, img.GetOriginalType()); NUnit.Framework.Assert.AreEqual(100, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(100, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(8, img.GetBpc()); NUnit.Framework.Assert.AreEqual(1, img.GetColorSpace()); NUnit.Framework.Assert.AreEqual(4, ((PngImageData)img).GetColorType()); NUnit.Framework.Assert.IsNotNull(img.GetImageMask()); NUnit.Framework.Assert.AreEqual(1, img.GetImageMask().GetColorSpace()); NUnit.Framework.Assert.AreEqual(8, img.GetImageMask().GetBpc()); }
public virtual void IndexedAddColorToAlphaImageTest() { ImageData img = ImageDataFactory.Create(sourceFolder + "indexedAddColorToAlpha.png"); NUnit.Framework.Assert.AreEqual(ImageType.PNG, img.GetOriginalType()); NUnit.Framework.Assert.AreEqual(346, img.GetWidth(), 0); NUnit.Framework.Assert.AreEqual(49, img.GetHeight(), 0); NUnit.Framework.Assert.AreEqual(2, img.GetBpc()); //Indexed colorspace contains one component indeed NUnit.Framework.Assert.AreEqual(1, img.GetColorSpace()); NUnit.Framework.Assert.AreEqual(3, ((PngImageData)img).GetColorType()); NUnit.Framework.Assert.IsNotNull(img.GetImageAttributes()); NUnit.Framework.Assert.AreEqual(0, ((int[])img.GetImageAttributes().Get(PngImageHelperConstants.MASK))[0]); NUnit.Framework.Assert.AreEqual(0, ((int[])img.GetImageAttributes().Get(PngImageHelperConstants.MASK))[1]); }