2000.04.28 02:38 "VC++ Release build causes problems", by Peter Montgomery
I just downloaded the 3.5.5 libtiff code, hoping it would solve a problem in the previous 3.4beta037 code I was using. It hasn't. The problem is that when I build the library for Win32 under VC++ as a debug build, the code behaves perfectly. However, when I create a release build, images come in that have color that looks like a B&W palleted image being viewed with a color palette. In other words, the colors are all screwy. Of course, not completely. Some of the colors are fine, and the most problematic colors seem to be very dark ones. I think, but have not been able to verify yet, that when a color channel is 0, the color is instead replaced with some sort of random, garbage number. It seems like some buffer is not being properly initialized and works in the debug build because the VC++ zeros all memory before use.
It's quite unlikely that the problem is in my code since all the other file formats I support work perfectly. I implemented TIFF support by using the same structure my other file formats use, but at the right time simply make a call to "TIFFReadScanline()" and then copy the results as needed. I also believe the problem may be limited to 4 channel RGBA images but work fine with 3 channel RGB images. Try loading the "Strike.tif" test image. When I do it under the debug build it works perfectly. With the release build, the background which should be black comes up pure white in most places and mult-colored at the transition to the bowling alley and pins.
Has anyone else encountered this? Is anyone else using VC++ with a release build and loading RGBA images?