public void updateBounds() {
    mBounds = mDrawable.getBounds();

    mWidth = mBounds.width() + mMargin.left + mMargin.right;
    mHeight = mBounds.height();
  }
A helper function to allow dropping in BetterImageSpan as a replacement to ImageSpan, and
allowing for center alignment if passed in.
fbcore/src/main/java/com/facebook/widget/text/span/BetterImageSpan.java