I m using .NET framework (tried 3.5 & 4.0) to load a .TIFF file and save it as .PNG. I expect two subsequent calls to the Save() method (using the same TIFF file) to produce the same PNG file. The produced files are, however, sometimes different.
The C# Code below show the problem:
Image sourceToConvert = Bitmap.FromFile("c:\tmp\F1.tif");
sourceToConvert.Save("c:\tmp\F1_gen.png", ImageFormat.Png);
for (int i = 0; i < 100; i++)
{
sourceToConvert = Bitmap.FromFile("c:\tmp\F1.tif");
sourceToConvert.Save("c:\tmp\F1_regen.png", ImageFormat.Png);
if (!CompareFileBytes("c:\tmp\F1_gen.png", "c:\tmp\F1_regen.png"))
MessageBox.Show("Diff" + i);
}
This will display Diff at iteration 8, 32, 33, 73 114, 155, 196 on Windows 64, while it does not display any errors on 32 bit machines. (I use x86 target; with x64 target, it is worse: diff at iteration 12, 13, 14, 15, ...)
是否有办法从“拯救”获得可再生的成果?