@@ -517,18 +517,15 @@ public virtual void ImageTest21() {
517517 /// <exception cref="System.IO.IOException"/>
518518 /// <exception cref="System.Exception"/>
519519 [ NUnit . Framework . Test ]
520- public virtual void PngImageTest ( ) {
521- String outFileName = destinationFolder + "pngTest.pdf" ;
522- String cmpFileName = sourceFolder + "cmp_pngTest.pdf" ;
523- PdfDocument pdf = new PdfDocument ( new PdfWriter ( outFileName ) ) ;
524- Document document = new Document ( pdf ) ;
525- iText . Layout . Element . Image png = new iText . Layout . Element . Image ( ImageDataFactory . Create ( sourceFolder + "test.png"
526- ) ) ;
527- png . SetAutoScale ( true ) ;
528- document . Add ( png ) ;
529- document . Close ( ) ;
530- NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , destinationFolder
531- , "diff_png_" ) ) ;
520+ public virtual void PngImageColorProfileTest ( ) {
521+ SimpleImageTest ( "pngColorProfileTest.pdf" , "png-color-profile-test.png" ) ;
522+ }
523+
524+ /// <exception cref="System.IO.IOException"/>
525+ /// <exception cref="System.Exception"/>
526+ [ NUnit . Framework . Test ]
527+ public virtual void PngImageIncorrectColorProfileTest ( ) {
528+ SimpleImageTest ( "pngIncorrectColorProfileTest.pdf" , "png-incorrect-color-profile-test.png" ) ;
532529 }
533530
534531 /// <summary>Image can be reused in layout, so flushing it on the very first draw is a bad thing.</summary>
@@ -777,5 +774,22 @@ public virtual void ImageWithMinMaxHeightTest01() {
777774 NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , destinationFolder
778775 , "diff" ) ) ;
779776 }
777+
778+ /// <exception cref="System.IO.IOException"/>
779+ /// <exception cref="System.Exception"/>
780+ private void SimpleImageTest ( String pdfName , String imageName ) {
781+ String outFileName = destinationFolder + pdfName ;
782+ String cmpFileName = sourceFolder + "cmp_" + pdfName ;
783+ String diff = "diff_" + pdfName + "_" ;
784+ PdfDocument pdf = new PdfDocument ( new PdfWriter ( outFileName ) ) ;
785+ Document document = new Document ( pdf ) ;
786+ iText . Layout . Element . Image png = new iText . Layout . Element . Image ( ImageDataFactory . Create ( sourceFolder + imageName
787+ ) ) ;
788+ png . SetAutoScale ( true ) ;
789+ document . Add ( png ) ;
790+ document . Close ( ) ;
791+ NUnit . Framework . Assert . IsNull ( new CompareTool ( ) . CompareByContent ( outFileName , cmpFileName , destinationFolder
792+ , diff ) ) ;
793+ }
780794 }
781795}
0 commit comments