summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graemeg@gmail.com>2013-04-06 02:36:50 +0100
committerGraeme Geldenhuys <graemeg@gmail.com>2013-04-06 02:36:50 +0100
commitfafdc9027a0ebbf7646ecc65cffb04f12f2a979d (patch)
tree248f5bbe9d9df54523f8ccf93ae37b50f5e61ce9 /src
parentbcd692ff5c6343ecfef3c4ad5c745b54e35ebf95 (diff)
downloadfpGUI-fafdc9027a0ebbf7646ecc65cffb04f12f2a979d.tar.xz
os/2 bitmaps with bitdepth of 1,4 or 8 have a 3 byte color palette.
I originally read it as a 4-byte color palette. This fixes the colors of images (mostly), but there still seems to be some or other decoding issues with larger than 65KB images.
Diffstat (limited to 'src')
-rw-r--r--src/corelib/fpg_imgfmt_bmp.pas7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/corelib/fpg_imgfmt_bmp.pas b/src/corelib/fpg_imgfmt_bmp.pas
index 296e515d..ff354898 100644
--- a/src/corelib/fpg_imgfmt_bmp.pas
+++ b/src/corelib/fpg_imgfmt_bmp.pas
@@ -1,7 +1,7 @@
{
fpGUI - Free Pascal GUI Toolkit
- Copyright (C) 2006 - 2010 See the file AUTHORS.txt, included in this
+ Copyright (C) 2006 - 2013 See the file AUTHORS.txt, included in this
distribution, for details of the copyright.
See the file COPYING.modifiedLGPL, included in this distribution,
@@ -415,11 +415,12 @@ begin
pcol := ppal;
pixelcnt := 0;
+ // OS/2 1.x bitmap with uses 3-byte palette
while (p) < (pdata) do
begin
- pcol^ := (LongWord(p[3]) shl 24) + (LongWord(p[2]) shl 16) + (LongWord(p[1]) shl 8) + LongWord(p[0]);
+ pcol^ := (LongWord($FF) shl 24) + (LongWord(p[2]) shl 16) + (LongWord(p[1]) shl 8) + LongWord(p[0]);
Inc(pcol);
- inc(p, 4);
+ inc(p, 3);
Inc(pixelcnt);
end;
end;