protected void writeScreenshot ( ScreenshotEntry screenshotEntry ) throws IOException { int heigth = screenshotEntry . getHeight ( ) * Integer . parseInt ( this . configuration . getImageHeight ( ) ) / 100 ; int width = screenshotEntry . getWidth ( ) * Integer . parseInt ( this . configuration . getImageWidth ( ) ) / 100 ; boolean large = width > Integer . parseInt ( this . configuration . getMaxImageWidth ( ) ) ; if ( large ) { writer . append ( "." ) . append ( screenshotEntry . getPhase ( ) . name ( ) ) . append ( NEW_LINE ) ; writer . append ( screenshotEntry . getLink ( ) ) . append ( " -> file://" ) . append ( screenshotEntry . getPath ( ) ) . append ( "[" ) . append ( this . resourceBundle . getString ( "asciidoc.reporter.screenshot" ) ) . append ( "]" ) . append ( NEW_LINE ) . append ( NEW_LINE ) ; } else { writer . append ( "." ) . append ( screenshotEntry . getPhase ( ) . name ( ) ) . append ( NEW_LINE ) ; writer . append ( "image::" ) . append ( screenshotEntry . getLink ( ) ) . append ( "[screenshot," + width + "," + heigth + "]" ) . append ( NEW_LINE ) . append ( NEW_LINE ) ; } }
Method that is called to write screenshot . This method is responsible to check the size of image .