无法正确显示某些JPEG格式/大小限制大小、正确、格式、JPEG

2023-09-04 04:22:44 作者:心死旳很干净

我有一个应用程序,我从网上下载的JPEG文件,去$ C C $他们,并在Windows Phone 7.1中显示。它运作良好,除了一个单独的JPEG文件。我尝试了应用程序与数百JPEG文件中,很少出现这种问题。

I have an app where I download jpegs from Web, decode them and display it on Windows Phone 7.1. It works well, except for one single jpeg file. I tried the app with hundreds of jpegs and this problem occurs rarely.

顺便说一句,我试着用PictureDe coder.De和codejpeg依据ImageTools'的JPEG德codeR解码JPEG文件。既产生了相同的结果。 %的图片60或%70显示为黑,其余的是正常的。

BTW, I tried decoding jpegs with PictureDecoder.DecodeJpeg and ImageTools' Jpeg decoder. Both yielded the same result. %60 or %70 of the picture appears as black and the rest is normal.

请注意:这不是2000像素的限制问题。我解决了这个由我去$ C C $他们分裂后的图像转换成数块。

Note: It's not a 2000 px limit problem. I solved that by splitting images into several pieces after I decode them.

另注:我查过的那些黑色区域的像素值,他们不为0(初始值)

Another Note: I checked pixel values of those black areas and they are not 0 (the initial value).

另注2:使用<图像> 控制在XAML和它的源设置为下面的作品的URL。但是,这不是一个选项,对我来说,我需要将其分割成数块(因为2000像素的问题)。

Another Note2: Using <image> control in XAML and setting its source to the URL below works. But that's not an option for me as I need to split it into several pieces (because of 2000 px problem).

下面是JPEG我有问题: http://d24w6bsrhbeh9d.cloudfront.net /photo/1840288_700b_v1.jpg

Here is a jpeg I'm having problem with: https://m.xsw88.com/allimgs/daicuo/20230904/7247.png.jpg

更新:当我去$ C $光盘JPEG,我EN codeD再次并将其保存到隔离本地存储,抓住该文件使用独立存储资源管理器工具。我可以这样显示图像是德codeD和连接codeD正常。我仍然invastigating的问题。

UPDATE: After I decoded that JPEG, I encoded it again and saved it to the Isolated Local Storage and grabbed that file using Isolated Storage Explorer Tool. I could display the image thus it was decoded and encoded properly. I'm still invastigating the issue.

推荐答案

我通过减少我的图片的最大高度解决了这个问题。随着Windows Phone 7的由2000像素×2000个像素的限制,我也相应地分裂我的图片。它的工作的数百张照片,除了少数(在100 1)。不,这不是一个浮点数四舍五入问题,各件有最大的高度。 2000像素。现在,我减少了最大数量从2000年到1800下方,它的工作原理。但是为什么出现这种情况仍是一个谜给我。

Problem Solved: Reason not found

I solved the problem by decreasing the max height of my images. As Windows Phone 7 is limited by 2000 px x 2000 px, I was splitting my images accordingly. It worked for hundreds of images except few (1 in 100). And no, it was not a floating number rounding problem, all pieces had height of max. 2000 pixels. Now I decreased that max number from 2000 to below 1800 and it works. However why this happens is still a mystery to me.