title: Referencing a file on SD-Card, Android
body: <p>I currently trying to carry out the same operation (OCR) on images in android, one option is to use the camera and the other is to load an image from the SD-CARD. The code works when taken from a camera where the code is</p>
  
  <pre><code>Bitmap bitmap = BitmapFactory.decodeFile(_path,options);
  </code></pre>
  
  <p>where _path is equal to the last image taken using the application ( <code>_path = DATA_PATH + "ocr.jpg";</code> ) . However when I try to use an image selected from the gallery where _path would equal,</p>
  
  <pre><code>imageCaptureUri = data.getData();
  _path = imageCaptureUri.getPath();
  </code></pre>
  
  <p>The program locks up with the error </p>
  
  <blockquote>
    <p>Failure deleiving result ResultInfo{who=null, request = 2, result = -1, data=intent {dat=content://media/external/images/media/26 typ=image/jpeg(has extras)}} to activity{com.project.projectActivity}: java.lang.NullPointerException</p>
  </blockquote>
  
  <p>If anybody has an idea of whats going on I'd like to hear from you !!</p>