public Dimension getMinDimension ( ) { long effWithMin = getEffectiveMinWidth ( ) ; long effHeightMin = getEffectiveMinHeight ( ) ; double effRatio = getRatio ( ) ; if ( effWithMin == 0 && effHeightMin > 0 && effRatio > 0 ) { effWithMin = Math . round ( effHeightMin * effRatio ) ; } if ( effWithMin > 0 && effHeightMin == 0 && effRatio > 0 ) { effHeightMin = Math . round ( effWithMin / effRatio ) ; } if ( effWithMin > 0 || effHeightMin > 0 ) { return new Dimension ( effWithMin , effHeightMin ) ; } else { return null ; } }
Get minimum dimensions for media format . If only with or height is defined the missing dimensions is calculated from the ratio . If no ratio defined either only width or height dimension is returned . If neither width or height are defined null is returned .