Hi Support,
by adding images to a PDF with PDFsharp, we got an issue in PdfImage.cs class. The attached image is identified as an white-on-black image, although it's a normal black-on-white image. Therefore, this image won't be included into PDF. Unfortunately, I'm not having a clue about image processing, so i would like to ask you, if you have any idea. The code snippet, which contains the bug (in my opinion) is in class PdfImage Line 640:
Code:
if (bits == 1)
{
if (paletteColors == 0)
isBitonal = 1;
if (paletteColors == 2)
{
if (paletteData[0] == 0 &&
paletteData[1] == 0 &&
paletteData[2] == 0 &&
paletteData[3] == 255 &&
paletteData[4] == 255 &&
paletteData[5] == 255)
isBitonal = 1; // Black on white
if (paletteData[5] == 0 &&
paletteData[4] == 0 &&
paletteData[3] == 0 &&
paletteData[2] == 255 &&
paletteData[1] == 255 &&
paletteData[0] == 255)
isBitonal = -1; // White on black
}
}
If you need more information, feel free to ask for it. Thank you!
Best regards
Fabian