#28726

Well, with your sample image we identified and fixed a bug in our code, related to 1-bit bitmap images.

However when I tried your original HTML sample with base64-encoded images, the BMP still failed to appear in the resulting PDF. Which is quite strange.

I have dumped base64-decoded image (“bad image”) and the second image you provided (“good image”). There is a difference in the file headers (the rests of the images are identical). See the attachment.

It is difficult to say if the “bad image” has been corrupted during base64 encoding or it is a species of BMP format, known only to Microsoft.

The impacted bytes are quite important:

Good image:
File type is :BM
Size of file is :4990
Size of bitmapinfoheader is :40
Width is :342
Height is :112
Planes is :1
BitCount is :1
Compression is :0
SizeImage is :4928
X-Pixels per meter is :0
Y-Pixels per meter is :0
Colors used are :2
Colors important are :2

Bad image:
File type is :BM
Size of file is :4990
Size of bitmapinfoheader is :40
Width is :342
Height is :112
Planes is :1
BitCount is :1
Compression is :0
SizeImage is :0
X-Pixels per meter is :2834
Y-Pixels per meter is :2834
Colors used are :2
Colors important are :0

It looks like MS IE repairs the “bad image” on-a-fly and displays it correctly. If you save the image from MS IE you’ll get an image byte-to-byte identical to the “good image”.

We would implement a workaround for such corrupted images, but it is not obvious how to obtain the missing “size of the raw bitmap data” value.