Symptom:
When you save or upload a image in buffer as a JPEG file, you may receive the following error message:
Cause:
You are saving a Black&White image as a JPEG file. JPEG standard defines that only 256 gray-scaled image and 24 bit RGB image can be compressed as JPEG format.
Resolution:
Please make sure the pixel type of the image in buffer is Gray or RGB. You can set the value of pixel type by using the PixelType property.
Code:
function btnScan_onclick()
{
frmScan.DynamicWebTwain1.SelectSource();
frmScan.DynamicWebTwain1.OpenSource();
frmScan.DynamicWebTwain1.PixelType = 2; //RGB
frmScan.DynamicWebTwain1.AcquireImage();
}
Reference:
PixelType HTTPUploadThroughPost SaveAsJPEG
