question: public static int computeMinImageSampleSize ( ImageSize srcSize ) { final int srcWidth = srcSize . getWidth ( ) ; final int srcHeight = srcSize . getHeight ( ) ; final int targetWidth = maxBitmapSize . getWidth ( ) ; final int targetHeight = maxBitmapSize . getHeight ( ) ; final int widthScale = ( int ) Math . ceil ( ( float ) srcWidth / targetWidth ) ; final int heightScale = ( int ) Math . ceil ( ( float ) srcHeight / targetHeight ) ; return Math . max ( widthScale , heightScale ) ; }
target:  Computes minimal sample size for downscaling image so result image size won't exceed max acceptable OpenGL texture size.<br /> We can't create Bitmap in memory with size exceed max texture size (usually this is 2048x2048) so this method calculate minimal sample size which should be applied to image to fit into these limits.