docs: public static float computeImageScale(ImageSize srcSize, ImageSize targetSize, ViewScaleType viewScaleType,
  			boolean stretch) {
  		final int srcWidth = srcSize.getWidth();
  		final int srcHeight = srcSize.getHeight();
  		final int targetWidth = targetSize.getWidth();
  		final int targetHeight = targetSize.getHeight();
  
  		final float widthScale = (float) srcWidth / targetWidth;
  		final float heightScale = (float) srcHeight / targetHeight;
  
  		final int destWidth;
  		final int destHeight;
  		if ((viewScaleType == ViewScaleType.FIT_INSIDE && widthScale >= heightScale) || (viewScaleType == ViewScaleType.CROP && widthScale < heightScale)) {
  			destWidth = targetWidth;
  			destHeight = (int) (srcHeight / widthScale);
  		} else {
  			destWidth = (int) (srcWidth / heightScale);
  			destHeight = targetHeight;
  		}
  
  		float scale = 1;
  		if ((!stretch && destWidth < srcWidth && destHeight < srcHeight) || (stretch && destWidth != srcWidth && destHeight != srcHeight)) {
  			scale = (float) destWidth / srcWidth;
  		}
  
  		return scale;
  	}