是否OneDrive变更/重新连接code JPG文件? [英] Does OneDrive change/re-encode jpg files?

查看:209
本文介绍了是否OneDrive变更/重新连接code JPG文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我也遇到了一个奇怪的问题,我无法调试。图像被上传经由一些code非常相似,给出的例子,一旦上传到Onedrive,图像是在OneDrive网络界面中可见。

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.

http://msdn.microsoft.com/en-us/library/ dn659727.aspx

当试图下载它,再次使用code从这个例子中,code的以下行

Upon trying to download it, again using code from the example, the following line of code

位图BMAP = BitmapFactory.de codeStream(输入);

Bitmap bMap = BitmapFactory.decodeStream(input);

也返回BMAP空值。我知道这些文件(这是我从从Android剪贴板复制和写入到磁盘上的文件获得)是有效的,B / C我的GridView元素和上传使用他们/它们下载到Dropbox的以类似的方式。

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.

是否有某种重新编码JPG的OneDrive执行(如RGB-> CKMY转换)什么将不再$ P $从工作pvent他们?

Is there some kind of jpg re-encoding performed in OneDrive (like RGB->CKMY conversion) what would no longer prevent them from working?

另外,有一些其他类型一样,需要被附加到file.XXXX OneDrive ID,将prevent任何/图片?类型=缩略图或/图片?类型=正常的查询参数可能的转换?

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?

有没有办法来调试正是为什么BitmapFactory.de codeStream()函数将失败,就像调试输出?

Is there a way to debug exactly why the BitmapFactory.decodeStream() function fails, like debugging output?

编辑:所以,我碰到下面的SO职位,想通了,这是我有同样的问题。

So, I came across the following SO post, and figured out this is the same problem I am having.

OneDrive - PNG文件尺寸错误

有关某个文件,如果我下载使用Onedrive SDK,并期待在流长度

For a certain file, if I download it using the Onedrive SDK and look at the stream length

public void onDownloadCompleted(LiveDownloadOperation operation) {
  int length = operation.getContentLength();
}

它报告的大小为2723字节,但如果我下载的文件,并使用桌面Web浏览器保存它,该文件是1837年字节。有什么我缺少关于阅读一流的大小,或者是API刚刚打破?

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?

推荐答案

在这个问题的答案显然是,有一个在Onedrive SDK的错误。我结束了在Github上提出一个问题与微软,而且事实证明,他们发现,某些类型的小图像(和潜在的PDF文件),实际的文件大小为传回后,下载是错误的。

The answer to this question apparently is, there is a bug in the Onedrive SDK. I ended up filing an issue on Github with Microsoft, and it turns out they discovered that with certain types of small images (and potentially PDFs), the actually file size being transmitted back after a download is wrong.

https://github.com/liveservices/LiveSDK-for-Android/issues/37#issuecomment-65457177

这一切都只是我在测试我的应用程序的方式一个奇怪的神器。由于Android版Chrome是唯一的应用程序,我已经发现,可以让您的图像复制到剪贴板,我只是谷歌搜索来查找(在基本的网页搜索结果的小缩略图)图像,这些复制到剪贴板。如果我一直在使用较大的图像,我可能从来没有过这个漏洞运行。

It's all just a weird artifact of the way I was testing my app. Since Chrome for Android is the only app I've discovered that lets you copy an image to the clipboard, I was just Google search to find images (tiny thumbnail images in the basic web search results), and copying those to the clipboard. Had I been using larger images, I may never have run across this bug.

这篇关于是否OneDrive变更/重新连接code JPG文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆