Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #26635

    My html file contains images in BMP format encoded as BASE64 (see example.zip).

    I downloaded the demo version of PD4ML and run the Converter.class to do a quick test:

    java -Xmx512m -cp pd4ml_demo.jar;ss_css2.jar;. Converter example.html example.pdf “” “”

    The GIF image has been successfully converted in the PDF file. But the BMP file is missing (see example.pdf).

    Does pd4ml support BMP files?

    #28724

    Does the BMP have transparency mask?
    Could you please publish the image in its original form (as BMP file)?
    Thank you!

    #28725

    Please find the file signature.bmp in the attached signature.zip file.

    #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.

    #28727

    http://en.wikipedia.org/wiki/BMP_file_format explains how to calculate SizeImage. I will update our code and set this value. Would it be possible that you send me a test pd4ml package containing the bug fix for 1 bit bmp files?

    #28728

    I’ve just sent the version to your email box.

    #28729

    I tested your bux fix. But it seems there is still a problem.

    Please find attached my example containing now BMP files which have set the ImageSize correctly (BMP file & BASE64 encoded).

    Could you have a look at it again?

    #28730

    I tested your bux fix. But it seems there is still a problem.

    Please find attached my example containing now BMP files which have set the ImageSize correctly.

    Could you have a look at it again?

    #28731

    Yes, the images you provided are still not compatible with PD4ML.

    I did the simple test again: opened your HTML in MS IE and saved the BMP as signature2.bmp and included it to example.html

    Obviously MS IE again repaired format errors of your BMP. See attached.

    I also compared signature.bmp and signature2.bmp. As I see 2 values “40” and “13” are swapped:

    #28732

    Many thanks!!! I didn’t take litte endian into account. Now it is working.

Viewing 10 posts - 1 through 10 (of 10 total)

The forum ‘General questions / FAQ’ is closed to new topics and replies.