private String resizeImage(String anImageUrl,String filename,ImageSize srcImageSize,ImageSize dstImageSize,int rotationAngle){
  String imageUrl=anImageUrl;
  try {
    if (null != dstImageSize) {
      FileInputStream imageStream=new FileInputStream(new File(filename));
      InputStream resizeBitmapStream=null;
      try {
        resizeBitmapStream=ImageUtils.resizeImage(imageStream,-1,(srcImageSize.mWidth + dstImageSize.mWidth - 1) / dstImageSize.mWidth,75);
      }
 catch (      OutOfMemoryError ex) {
        Log.e(LOG_TAG,"resizeImage out of memory : " + ex.getMessage());
      }
catch (      Exception e) {
        Log.e(LOG_TAG,"resizeImage failed : " + e.getMessage());
      }
      if (null != resizeBitmapStream) {
        String bitmapURL=mMediasCache.saveMedia(resizeBitmapStream,null,CommonActivityUtils.MIME_TYPE_JPEG);
        if (null != bitmapURL) {
          imageUrl=bitmapURL;
        }
        resizeBitmapStream.close();
      }
    }
    if (0 != rotationAngle) {
      ImageUtils.rotateImage(mVectorRoomActivity,imageUrl,rotationAngle,mMediasCache);
    }
  }
 catch (  Exception e) {
    Log.e(LOG_TAG,"resizeImage " + e.getMessage());
  }
  return imageUrl;
}

private String resizeImage ( String anImageUrl , String filename , ImageSize srcImageSize , ImageSize dstImageSize , int rotationAngle ) { String imageUrl = anImageUrl ; try { if ( null != dstImageSize ) { FileInputStream imageStream = new FileInputStream ( new File ( filename ) ) ; InputStream resizeBitmapStream = null ; try { resizeBitmapStream = ImageUtils . resizeImage ( imageStream , - 1 , ( srcImageSize . mWidth + dstImageSize . mWidth - 1 ) / dstImageSize . mWidth , 75 ) ; } catch ( OutOfMemoryError ex ) { Log . e ( LOG_TAG , "resizeImage out of memory : " + ex . getMessage ( ) ) ; } catch ( Exception e ) { Log . e ( LOG_TAG , "resizeImage failed : " + e . getMessage ( ) ) ; } if ( null != resizeBitmapStream ) { String bitmapURL = mMediasCache . saveMedia ( resizeBitmapStream , null , CommonActivityUtils . MIME_TYPE_JPEG ) ; if ( null != bitmapURL ) { imageUrl = bitmapURL ; } resizeBitmapStream . close ( ) ; } } if ( 0 != rotationAngle ) { ImageUtils . rotateImage ( mVectorRoomActivity , imageUrl , rotationAngle , mMediasCache ) ; } } catch ( Exception e ) { Log . e ( LOG_TAG , "resizeImage " + e . getMessage ( ) ) ; } return imageUrl ; }
apply an image with an expected size . a rotation might also be applied if provided .
