From f3779a9c06768a5811f4cd975aa2610819872d28 Mon Sep 17 00:00:00 2001 From: "Mirar (Pontus Hagland)" <pike@sort.mirar.org> Date: Sun, 2 May 1999 17:33:19 +0200 Subject: [PATCH] decoder works for 24 bits w/ alignment Rev: src/modules/Image/encodings/bmp.c:1.8 --- src/modules/Image/encodings/bmp.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/modules/Image/encodings/bmp.c b/src/modules/Image/encodings/bmp.c index d4c759fa0f..605a6f43e8 100644 --- a/src/modules/Image/encodings/bmp.c +++ b/src/modules/Image/encodings/bmp.c @@ -1,9 +1,9 @@ -/* $Id: bmp.c,v 1.7 1999/05/02 15:29:16 mirar Exp $ */ +/* $Id: bmp.c,v 1.8 1999/05/02 15:33:19 mirar Exp $ */ /* **! module Image **! note -**! $Id: bmp.c,v 1.7 1999/05/02 15:29:16 mirar Exp $ +**! $Id: bmp.c,v 1.8 1999/05/02 15:33:19 mirar Exp $ **! submodule BMP **! **! This submodule keeps the BMP (Windows Bitmap) @@ -22,7 +22,7 @@ #include <ctype.h> #include "stralloc.h" -RCSID("$Id: bmp.c,v 1.7 1999/05/02 15:29:16 mirar Exp $"); +RCSID("$Id: bmp.c,v 1.8 1999/05/02 15:33:19 mirar Exp $"); #include "pike_macros.h" #include "object.h" #include "constants.h" @@ -522,6 +522,8 @@ void i_img_bmp__decode(INT32 args,int header_only) if (comp) error("Image.BMP.decode: can't handle compressed 24bpp BMP\n"); + skip=(4-(img->xsize*3)&3)&3; + j=(len)/3; y=img->ysize; while (j && y--) @@ -536,6 +538,7 @@ void i_img_bmp__decode(INT32 args,int header_only) d->r=*(s++); d++; } + if (j>=skip) { j-=skip; s+=skip; } } break; case 8: -- GitLab