JPEG DECOM pression跨Windows架构不一致 [英] JPEG decompression inconsistent across Windows architectures

查看:235
本文介绍了JPEG DECOM pression跨Windows架构不一致的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在测试上了一堆不同版本的Windows的计算机的JPEG DECOM pression。所有这些计算机有.NET 4安装,我对编译.NET 2和任何CPU平台的目标。下面code产生在不同的系统不同的输出。

I am testing JPEG decompression on a bunch of computers with different versions of Windows. All of these computers have .NET 4 installed and I am compiling against .NET 2 and the "Any CPU" platform target. The following code produces different output on different systems.

Bitmap bmp = (Bitmap)Image.FromFile("test.jpg");

long datasum = 0;
for (int y = 0; y < bmp.Height; y++)
    for (int x = 0; x < bmp.Width; x++)
        datasum = datasum + bmp.GetPixel(x, y).R + bmp.GetPixel(x, y).G + bmp.GetPixel(x, y).B;

Console.WriteLine(datasum);

所有的Win7 64位和WinXP 32位的机器产生一个结果。而所有的Win7 32位机器产生另一种结果。

All the Win7 64-bit and WinXP 32-bit machines produce one result. And all the Win7 32-bit machines produce another result.

任何想法,为什么输出会有所不同?

Any ideas why the output would be different?

推荐答案

可以进行相关的这个

尝试useEmbeddedColorManagement参数设置为true。

Try setting useEmbeddedColorManagement parameter to true.

这篇关于JPEG DECOM pression跨Windows架构不一致的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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