question: public static int determineSampleSize ( ImageRequest imageRequest , EncodedImage encodedImage ) { if ( ! EncodedImage . isMetaDataAvailable ( encodedImage ) ) { return DEFAULT_SAMPLE_SIZE ; } float ratio = determineDownsampleRatio ( imageRequest , encodedImage ) ; int sampleSize ; if ( encodedImage . getImageFormat ( ) == ImageFormat . JPEG ) { sampleSize = ratioToSampleSizeJPEG ( ratio ) ; } else { sampleSize = ratioToSampleSize ( ratio ) ; } int maxDimension = Math . max ( encodedImage . getHeight ( ) , encodedImage . getWidth ( ) ) ; while ( maxDimension / sampleSize > MAX_BITMAP_SIZE ) { if ( encodedImage . getImageFormat ( ) == ImageFormat . JPEG ) { sampleSize *= 2 ; } else { sampleSize ++ ; } } return sampleSize ; }
target:  Get the factor between the dimensions of the encodedImage (actual image) and the ones of the imageRequest (requested size).