width = image.getHeight();
height = image.getHeight();
    protected void calcDimensions() {        try {            bufferResource();                        if ( buffer!=null && buffer.isValid()) {                BufferedImage image =                     ImageIO.read(new ByteArrayInputStream(buffer.getBytes()));                width = image.getWidth();                width = image.getHeight();            }        } catch ( Throwable e ) {            // is not possible to calc Dimensions            // maybe it is not possible to buffer resource,             // or resource is not a            // supported image type        }    }