question: public void put ( final Resources res , final String key , RecyclingBitmapDrawable bmp , final boolean asPNG ) { boolean isDefaultArt = false ; final String cleanKey = sanitizeKey ( key ) ; if ( bmp == null ) { bmp = new RecyclingBitmapDrawable ( res , mDefaultArt . copy ( mDefaultArt . getConfig ( ) , false ) ) ; isDefaultArt = true ; } if ( USE_MEMORY_CACHE ) { mMemoryCache . put ( cleanKey , bmp ) ; } if ( ! isDefaultArt ) { try { FileOutputStream out = new FileOutputStream ( mCacheDir . getAbsolutePath ( ) + "/" + cleanKey ) ; Bitmap bitmap = bmp . getBitmap ( ) ; boolean shouldRecycle = false ; final float maxSize = 800 ; if ( bitmap . getWidth ( ) > maxSize && bitmap . getHeight ( ) > maxSize ) { float ratio = ( bitmap . getWidth ( ) < bitmap . getHeight ( ) ) ? bitmap . getWidth ( ) / maxSize : bitmap . getHeight ( ) / maxSize ; final int sWidth = ( int ) ( bitmap . getWidth ( ) / ratio ) ; final int sHeight = ( int ) ( bitmap . getHeight ( ) / ratio ) ; bitmap = Bitmap . createScaledBitmap ( bitmap , sWidth , sHeight , true ) ; shouldRecycle = true ; Log . d ( TAG , "Rescaled to " + sWidth + "x" + sHeight ) ; } bitmap . compress ( asPNG ? Bitmap . CompressFormat . PNG : Bitmap . CompressFormat . JPEG , 90 , out ) ; out . close ( ) ; if ( shouldRecycle ) { bitmap . recycle ( ) ; } } catch ( IOException e ) { Log . e ( TAG , "Unable to write the file to cache" , e ) ; } synchronized ( mEntries ) { mEntries . add ( cleanKey ) ; } } }
target:  Stores the image as either JPEG or PNG in the cache