title: Does OneDrive change/re-encode jpg files?
body: <p>I have encountered a strange problem I am unable to debug. An image is uploaded to Onedrive via some code very similar to the given example, and once uploaded, the image is visible in the OneDrive web interface.</p>
  
  <p><a href="http://msdn.microsoft.com/en-us/library/dn659727.aspx" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/dn659727.aspx</a></p>
  
  <p>Upon trying to download it, again using code from the example, the following line of code</p>
  
  <p>Bitmap bMap = BitmapFactory.decodeStream(input);</p>
  
  <p>also returns a null value for bMap.  I know these files (which I obtain from copying from the Android Clipboard and writing to a file on disk) are valid, b/c I use them in Gridview elements and upload/download them to Dropbox in a similar way.</p>
  
  <p>Is there some kind of jpg re-encoding performed in OneDrive (like RGB->CKMY conversion) what would no longer prevent them from working?</p>
  
  <p>Also, is there some other type of query parameter like "/picture?type=thumbnail" or "/picture?type=normal" that needs to be appended to a file.XXXX OneDrive ID that would prevent any possible conversion?</p>
  
  <p>Is there a way to debug exactly why the BitmapFactory.decodeStream() function fails, like debugging output?</p>
  
  <p>EDIT:  So, I came across the following SO post, and figured out this is the same problem I am having.</p>
  
  <p><a href="https://stackoverflow.com/questions/26906007/onedrive-wrong-size-for-png-files">OneDrive - Wrong size for PNG files</a></p>
  
  <p>For a certain file, if I download it using the Onedrive SDK and look at the stream length</p>
  
  <pre><code>public void onDownloadCompleted(LiveDownloadOperation operation) {
    int length = operation.getContentLength();
  }
  </code></pre>
  
  <p>it reports a size of 2723 bytes, but if I download the file and save it using a desktop web browser, the file is 1837 bytes.  Is there something I am missing about reading the size of a stream, or is the API just broken?</p>