diff options
| author | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-13 18:18:33 +0000 |
|---|---|---|
| committer | Michael R Sweet <michael.r.sweet@gmail.com> | 2002-06-13 18:18:33 +0000 |
| commit | 91aa5847ba00e27c3f7b94068960daff0c930110 (patch) | |
| tree | 64eb9bb525f154cb366a859238f525785fbfb3bb /src/Fl_BMP_Image.cxx | |
| parent | 1f30c63d322778388a167f82df5d27a76e115ab5 (diff) | |
Bug fixes from Sebastien.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2309 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_BMP_Image.cxx')
| -rw-r--r-- | src/Fl_BMP_Image.cxx | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/Fl_BMP_Image.cxx b/src/Fl_BMP_Image.cxx index 16c392849..9df36f8c2 100644 --- a/src/Fl_BMP_Image.cxx +++ b/src/Fl_BMP_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_BMP_Image.cxx,v 1.1.2.5 2002/06/10 17:21:49 easysw Exp $" +// "$Id: Fl_BMP_Image.cxx,v 1.1.2.6 2002/06/13 18:18:33 easysw Exp $" // // Fl_BMP_Image routines. // @@ -94,19 +94,23 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read // Then the bitmap information... info_size = read_dword(fp); - w(read_long(fp)); - h(read_long(fp)); - read_word(fp); - depth = read_word(fp); if (info_size < 40) { // Old Windows/OS2 BMP header... + w(read_word(fp)); + h(read_word(fp)); + read_word(fp); + depth = read_word(fp); compression = BI_RGB; colors_used = 0; - count = info_size - 12; + count = info_size - 8; } else { // New BMP header... + w(read_long(fp)); + h(read_long(fp)); + read_word(fp); + depth = read_word(fp); compression = read_dword(fp); read_dword(fp); read_long(fp); @@ -129,7 +133,7 @@ Fl_BMP_Image::Fl_BMP_Image(const char *bmp) // I - File to read for (count = 0; count < colors_used; count ++) { // Read BGR color... - fread(colormap, colors_used, 3, fp); + fread(colormap[count], colors_used, 3, fp); // Skip pad byte for new BMP files... if (info_size > 12) getc(fp); @@ -371,5 +375,5 @@ read_long(FILE *fp) { // I - File to read from // -// End of "$Id: Fl_BMP_Image.cxx,v 1.1.2.5 2002/06/10 17:21:49 easysw Exp $". +// End of "$Id: Fl_BMP_Image.cxx,v 1.1.2.6 2002/06/13 18:18:33 easysw Exp $". // |
