git » fp-git.git » commit 0d9d75d

bugfixed the .bmp support, now the image extraction has been completely restored

author ecalot
2006-02-19 07:36:45 UTC
committer ecalot
2006-02-19 07:36:45 UTC
parent b51d5cb7aa44b59049a0e5e2bf6608391ad109df

bugfixed the .bmp support, now the image extraction has been completely restored

PR/src/lib/actions/export.c +0 -2
PR/src/lib/formats/bmp.c +3 -3
PR/src/lib/object/image/image16.c +0 -1
PR/src/lib/object/image/image2.c +0 -1
PR/src/lib/object/image/image256.c +0 -1
PR/src/lib/object/image/image_common.c +0 -1

diff --git a/PR/src/lib/actions/export.c b/PR/src/lib/actions/export.c
index cedcfd4..9b5ad0f 100644
--- a/PR/src/lib/actions/export.c
+++ b/PR/src/lib/actions/export.c
@@ -106,7 +106,6 @@ int extract(const char* vFiledat,const char* vDirExt, tResourceList* r, int opti
 				tObject o;
 				if (hasFlag(raw_flag)) res.type=0; /* If "extract as raw" is set, type is 0 */
 
-printf("ok=%d ok2=%d type=%d\n",ok,ok2,res.type);
 				/* get save file name (if unknown document is in the XML) */
 				getFileName(file,vDirExt,&res,vFiledat,vDatFileName,optionflag,backupExtension,format);
 
@@ -120,7 +119,6 @@ printf("ok=%d ok2=%d type=%d\n",ok,ok2,res.type);
 					}	break;
 					case eResTypeImage: /* save image */
 						/* Palette handling */
-printf("id=(%d,%s,%d)\n",res.paletteId.value,res.paletteId.index,res.paletteId.order);
 						if (resourceListCompareId(res.paletteId,bufferedPalette) /*TODO: add &&!paletteCheckCompatibility(currentPalette,image) */) { /* The palette isn't in the buffer */
 							tResource otherPalette;
 							otherPalette.id=res.paletteId;
diff --git a/PR/src/lib/formats/bmp.c b/PR/src/lib/formats/bmp.c
index e1062ba..959e27a 100644
--- a/PR/src/lib/formats/bmp.c
+++ b/PR/src/lib/formats/bmp.c
@@ -48,14 +48,14 @@ int mWriteBmp(const char* file,const unsigned char* data, int w, int h, int bits
 	/* declare variables */
 	int a;
 	unsigned short int planes=1;
-	unsigned long int colours;
+	unsigned long int colours=colors;
 	unsigned long int extra=1000;
 	unsigned long int filesize;
 	unsigned long int headerSize;
-	unsigned long int height;
+	unsigned long int height=h;
 	unsigned long int offset;
 	unsigned char color;
-	unsigned long int width;
+	unsigned long int width=w;
 	const unsigned long int zero=0;
 	char lineSerialization;
 	FILE* bitmap;
diff --git a/PR/src/lib/object/image/image16.c b/PR/src/lib/object/image/image16.c
index e5f8fa8..c4a8912 100644
--- a/PR/src/lib/object/image/image16.c
+++ b/PR/src/lib/object/image/image16.c
@@ -185,7 +185,6 @@ int mExpandGraphic(const unsigned char* data,tImage *image, int dataSizeInBytes)
 	if (image->type==0xf3)
 		return pop2decompress(data,dataSizeInBytes-6,image->width,&(image->pix),&imageSizeInBytes);
 
-
 #define checkSize if (imageSizeInBytes!=(image->widthInBytes*image->height))\
 	return COMPRESS_RESULT_FATAL
 #define checkResult if (result==COMPRESS_RESULT_FATAL)\
diff --git a/PR/src/lib/object/image/image2.c b/PR/src/lib/object/image/image2.c
index e5f8fa8..c4a8912 100644
--- a/PR/src/lib/object/image/image2.c
+++ b/PR/src/lib/object/image/image2.c
@@ -185,7 +185,6 @@ int mExpandGraphic(const unsigned char* data,tImage *image, int dataSizeInBytes)
 	if (image->type==0xf3)
 		return pop2decompress(data,dataSizeInBytes-6,image->width,&(image->pix),&imageSizeInBytes);
 
-
 #define checkSize if (imageSizeInBytes!=(image->widthInBytes*image->height))\
 	return COMPRESS_RESULT_FATAL
 #define checkResult if (result==COMPRESS_RESULT_FATAL)\
diff --git a/PR/src/lib/object/image/image256.c b/PR/src/lib/object/image/image256.c
index e5f8fa8..c4a8912 100644
--- a/PR/src/lib/object/image/image256.c
+++ b/PR/src/lib/object/image/image256.c
@@ -185,7 +185,6 @@ int mExpandGraphic(const unsigned char* data,tImage *image, int dataSizeInBytes)
 	if (image->type==0xf3)
 		return pop2decompress(data,dataSizeInBytes-6,image->width,&(image->pix),&imageSizeInBytes);
 
-
 #define checkSize if (imageSizeInBytes!=(image->widthInBytes*image->height))\
 	return COMPRESS_RESULT_FATAL
 #define checkResult if (result==COMPRESS_RESULT_FATAL)\
diff --git a/PR/src/lib/object/image/image_common.c b/PR/src/lib/object/image/image_common.c
index e5f8fa8..c4a8912 100644
--- a/PR/src/lib/object/image/image_common.c
+++ b/PR/src/lib/object/image/image_common.c
@@ -185,7 +185,6 @@ int mExpandGraphic(const unsigned char* data,tImage *image, int dataSizeInBytes)
 	if (image->type==0xf3)
 		return pop2decompress(data,dataSizeInBytes-6,image->width,&(image->pix),&imageSizeInBytes);
 
-
 #define checkSize if (imageSizeInBytes!=(image->widthInBytes*image->height))\
 	return COMPRESS_RESULT_FATAL
 #define checkResult if (result==COMPRESS_RESULT_FATAL)\