From 1bcba05b4a51c4bf4a8c915132a41249e7a2c312 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Mon, 27 Apr 1998 16:16:23 +0000 Subject: [PATCH] Updated bmp plug-in. --Sven --- ChangeLog | 4 ++++ plug-ins/bmp/bmp.c | 4 ++-- plug-ins/bmp/bmpwrite.c | 7 ++++--- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 217a3883f3..8ee7613d53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Mon Apr 27 18:09:01 MEST 1998 Sven Neumann + + * updated bmp plug-in + Sun Apr 26 16:31:06 PDT 1998 Manish Singh * Made 0.99.28 release diff --git a/plug-ins/bmp/bmp.c b/plug-ins/bmp/bmp.c index a847677d7f..22b0986b1e 100644 --- a/plug-ins/bmp/bmp.c +++ b/plug-ins/bmp/bmp.c @@ -1,5 +1,5 @@ /* bmp.c */ -/* Version 0.43 */ +/* Version 0.44 */ /* This is a File input and output filter for */ /* Gimp. It loads and saves images in windows(TM) */ /* bitmap format. */ @@ -16,7 +16,7 @@ /* 06.04.1998 Bugfix in Padding */ /* 11.04.1998 Arch. cleanup (-Wall) */ /* Parses gtkrc */ - +/* 14.04.1998 Another Bug in Padding */ /* * The GIMP -- an image manipulation program * Copyright (C) 1995 Spencer Kimball and Peter Mattis diff --git a/plug-ins/bmp/bmpwrite.c b/plug-ins/bmp/bmpwrite.c index 407078a9bd..af34333ad2 100644 --- a/plug-ins/bmp/bmpwrite.c +++ b/plug-ins/bmp/bmpwrite.c @@ -52,7 +52,7 @@ WriteBMP (filename,image,drawable_ID) int Green[MAXCOLORS]; int Blue[MAXCOLORS]; unsigned char *cmap; - int rows, cols, channels, MapSize, SpZeile; + int rows, cols, Spcols, channels, MapSize, SpZeile; long BitsPerPixel; int colors; char *temp_buf; @@ -160,8 +160,9 @@ WriteBMP (filename,image,drawable_ID) /* ... that we write to our headers. */ - if ((((cols*BitsPerPixel)/8) % 4) == 0) SpZeile=((cols*BitsPerPixel)/8); - else SpZeile=((int)(((cols*BitsPerPixel)/8)/4)+1)*4; + if ((BitsPerPixel != 24) && (cols % (8/BitsPerPixel))) Spcols=(((cols / (8/BitsPerPixel))+1)*(8/BitsPerPixel)); else Spcols=cols; + if ((((Spcols*BitsPerPixel)/8) % 4) == 0) SpZeile=((Spcols*BitsPerPixel)/8); + else SpZeile=((int)(((Spcols*BitsPerPixel)/8)/4)+1)*4; Bitmap_File_Head.bfSize=0x36+MapSize+(rows*SpZeile); Bitmap_File_Head.reserverd=0; Bitmap_File_Head.bfOffs=0x36+MapSize;