Menu

#559 Support for "Windows 98/2000 and newer" BMP format

3.0 Series
open
nobody
None
5
2024-05-30
2021-05-26
No

The generated installer can't show BPM images in the wizard if they are genererated with the format that says "Windows 98/2000 and newer". They must be generated with "Windows 3.x".

There seems to be fewer and fewer tools that generates this very old format, e.g. Gimp cannot.

Updating the image loading code in the wizard to accept this format too would prevent a lot of unnecessary Googling.

This is the output of Linux command "file" on two examples, the first does not show, the second does.

images/nsis_setup.bmp:                    PC bitmap, Windows 98/2000 and newer format, 150 x 57 x 24
setup_wizard.bmp:                         PC bitmap, Windows 3.x format, 164 x 306 x 24, image size 150552, resolution 11700 x 11700 px/m, cbSize 150606, bits offset 54

Discussion

  • Anders

    Anders - 2021-05-31

    It would be helpful if you could attach a copy of a bitmap that fails. I assume you mean a BITMAPV5HEADER file but who knows.

    The installer does not parse the image itself, it uses the LoadImage function provided by Windows!

    These newer image formats add support for bitfields, transparency and color profiles, not really relevant for these wizard images.

    https://gitlab.gnome.org/GNOME/gimp/-/issues/6114 and https://gitlab.gnome.org/GNOME/gimp/-/issues/2010 might also be relevant.

     

    Last edit: Anders 2021-05-31
  • Thomas Nilefalk

    Thomas Nilefalk - 2021-06-13

    You are probably right. I was jumping at conclusions from the observations I had.
    Every converter I tried that produced "98/2000"-format failed to load, but they were all on-line converters, and they might well be powered by GIMP.

    So, the issues you point to are probably the root cause of what I'm seeing.

    I'll close this request and open another if I continue to see this issue after the GIMP-problems have been fixed.

     
    • Anders

      Anders - 2021-06-13

      I doubt websites are using Gimp on the back end, probably ImageMagic or some other converter. ImageMagic still supports the old format with a command line switch (-win3 maybe?).

       
  • Thomas Nilefalk

    Thomas Nilefalk - 2021-06-13

    So, it seems like I can't close my own issues? Then I'm ok if you want to do that, thanks.

     
  • Matthias Seidel

    Matthias Seidel - 2021-06-13

    GIMP can save such BMP for NSIS if you enable "Do not write color space information"

     
  • Anders

    Anders - 2021-06-15

    LoadImage only seems to support the classic 40 byte BITMAPINFOHEADER format. Why, I don't know but that is the way it is. You simply have to store the bitmap in this format. Paint on Windows 10 still uses this format (plain RGB, no bitfields).

     
    • Thomas Nilefalk

      Thomas Nilefalk - 2021-06-15

      Thank you very much, Anders, for investigating this. And I'm glad it wasn't me, but sad it was a problem.

      it is good to know, and will probably trip more and more users off.

      A check for the image format would then be very valuable to give earlier feedback. Unless there is an alternative to LoadImage...

       
    • Anders

      Anders - 2021-06-17
      • OleLoadPicturePath seems to have the same issue.
      • Calling CreateDIBSection will require our own file parsing, not ideal.
      • IImgCtx but it is async and it is not going to exist on 95 and NT4 nor IE9+.
      • GDI+ only exists on XP and later.
      • WIC only exists on XP and later.
       

      Last edit: Anders 2021-06-20
  • Anders

    Anders - 2021-06-25
    • The compiler will now warn you if a unsupported bitmap format is used.
    • This is a request to fix bug #681
     
    👍
    2
  • Melroy van den Berg

    What about supporting PNG images or something?

     
    • Anders

      Anders - 2024-05-30

      You can use icon controls for graphics on custom pages and a .ico with a compressed PNG inside if your target is Vista or higher...

       

Log in to post a comment.

MongoDB Logo MongoDB