protected boolean calculateSize(){
  p_width=0;
  p_height=0;
  if (m_image == null)   return true;
  if (waitForLoad(m_image) && m_image != null) {
    p_width=m_image.getWidth(this);
    p_height=m_image.getHeight(this);
    if (p_width * p_height == 0)     return true;
    m_scaleFactor=1;
    if (p_maxWidth != 0 && p_width > p_maxWidth)     m_scaleFactor=p_maxWidth / p_width;
    if (p_maxHeight != 0 && p_height > p_maxHeight && p_maxHeight / p_height < m_scaleFactor)     m_scaleFactor=p_maxHeight / p_height;
    p_width=(float)m_scaleFactor * p_width;
    p_height=(float)m_scaleFactor * p_height;
  }
 else {
    m_image=null;
  }
  return true;
}

protected boolean calculateSize ( ) { p_width = 0 ; p_height = 0 ; if ( m_image == null ) return true ; if ( waitForLoad ( m_image ) && m_image != null ) { p_width = m_image . getWidth ( this ) ; p_height = m_image . getHeight ( this ) ; if ( p_width * p_height == 0 ) return true ; m_scaleFactor = 1 ; if ( p_maxWidth != 0 && p_width > p_maxWidth ) m_scaleFactor = p_maxWidth / p_width ; if ( p_maxHeight != 0 && p_height > p_maxHeight && p_maxHeight / p_height < m_scaleFactor ) m_scaleFactor = p_maxHeight / p_height ; p_width = ( float ) m_scaleFactor * p_width ; p_height = ( float ) m_scaleFactor * p_height ; } else { m_image = null ; } return true ; }
calculate image size . set p_width & p_height
