Article 6R3ZT I wrote a BMP library, feedback welcome

I wrote a BMP library, feedback welcome

by
rupertwh
from LinuxQuestions.org on (#6R3ZT)
Hi there,
I guess most of us have one point done at least a quick and dirty import/export of Windows BMP files, because it's an easy way to get images into our out of your program. Usually limited to the 24-bit non-compressed format.
Well, it happened to me again, then I thought why not make it a library, then OCD took over and I found myself writing code for every BMP variant I know and didn't know of, including RLE-compressed, BI_BITFIELDS, etc.

My goal now is to make it a rock-solid open-source library that can read and write pretty much any variant of BMP files.

It's nearing completion and already reads more BMP variants than Windows viewer, Photoshop or Gimp.

Still missing is (mainly):
  • writing RLE (almost done) and (maybe?) 64-bit BMPs
  • reading Huffman encoding (old OS/2 variant)
  • reading/writing color information (icc profiles, gamma, etc.)
  • icon/pointer etc. For now only "BM" files
The library can be downloaded from Github. At the bottom of API.md there are some simple examples.

I'd love to get feedback, especially:
- if you have any real-world examples of BMPs that cannot be read yet. (preferably upload as new issue on Github)
- any real-world examples of Huffman-encoded and 64-bit BMPs. All I have is one sample each and not a lot of information about those formats.
- is there anything you find terrible about the API, that you wish was different?
[edit, forgot two important points:]
- I wrote the code to be endianess-agnostic, but it would be a miracle if I didn't mess it up somewhere. Would love to hear from someone trying it on big-endian hardware.
- Same goes for other OSs/compilers than Linux+gcc, what kind of preprocessor-defines/macros or compile/link options would be needed?
Cheers

Rupert
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments