title: resize image from file
body: <p>I am uploading an image to a server and before that happens, I would like to resize the image dimensions. I get the image with a <code>URI</code> like this:</p>
  
  <pre><code>Constants.currImageURI = data.getData();
  </code></pre>
  
  <p>this is the call to upload the image:</p>
  
  <pre><code>String response = uploadUserPhoto(new File(getRealPathFromURI(Constants.currImageURI)));
  
      public String uploadUserPhoto(File image) {
  
      DefaultHttpClient mHttpClient;
      HttpParams params = new BasicHttpParams();
      params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);
      mHttpClient = new DefaultHttpClient(params);
  
      try {
          HttpPost httppost = new HttpPost("http://myurl/mobile/image");
  
          MultipartEntity multipartEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);  
          multipartEntity.addPart("userID", new StringBody(Constants.userID));
          multipartEntity.addPart("uniqueMobileID", new StringBody(Constants.uniqueMobileID));
          multipartEntity.addPart("userfile", new FileBody(image, "mobileimage.jpg", "image/jpeg", "UTF-8"));
          httppost.setEntity(multipartEntity);
  
          HttpResponse response = mHttpClient.execute(httppost);
          String responseBody = EntityUtils.toString(response.getEntity());
  
          Log.d(TAG, "response: " + responseBody);
          return responseBody;
  
      } catch (Exception e) {
         Log.d(TAG, e.getMessage());
      }
      return "";
  }
  </code></pre>
  
  <p>Is there a way to resize the file based on pixel dimensions?</p>
  
  <p>Thanks.</p>