author | ecalot
<ecalot> 2006-07-17 06:44:17 UTC |
committer | ecalot
<ecalot> 2006-07-17 06:44:17 UTC |
parent | 4f55c70ae55cf8d2c8f16784bc2d0b70af72b4c3 |
PR/src/lib/actions/export.c | +2 | -0 |
PR/src/lib/object/image/image16.c | +1 | -1 |
PR/src/lib/object/image/image2.c | +5 | -2 |
diff --git a/PR/src/lib/actions/export.c b/PR/src/lib/actions/export.c index b45f044..286c56c 100644 --- a/PR/src/lib/actions/export.c +++ b/PR/src/lib/actions/export.c @@ -128,6 +128,8 @@ printf("new palette object: o=%p type=%d\n",o.obj,o.type); /* Read the palette and load it into memory */ if (resourceListCompareId(res.paletteId,nullPalette)) { /* The palette isn't in the buffer */ if (mReadFileInDatFileId(&otherPalette)==PR_RESULT_SUCCESS) { + resourceListAddInfo(r,&otherPalette); /* this is nessesary to get the palette type */ + if (!otherPalette.type) otherPalette.type=verifyHeader(otherPalette.content); /* in case of error, an autodetection will be performed */ o=objectCreate(&otherPalette,&ok); printf("adding "); showobj(o); diff --git a/PR/src/lib/object/image/image16.c b/PR/src/lib/object/image/image16.c index 4155694..cf73d55 100644 --- a/PR/src/lib/object/image/image16.c +++ b/PR/src/lib/object/image/image16.c @@ -99,7 +99,7 @@ tColor* objPalette_16() { return c; } -void* objectImage16Create(tBinary cont, int *error) { /* use get like main.c */ +void* objectImage16Create(tBinary cont, int *error) { /* * This function will expand the data into an image structure, diff --git a/PR/src/lib/object/image/image2.c b/PR/src/lib/object/image/image2.c index f2cea74..aa6473a 100644 --- a/PR/src/lib/object/image/image2.c +++ b/PR/src/lib/object/image/image2.c @@ -101,7 +101,7 @@ tColor* objPalette_pop1_monoGetColors() { extern FILE* outputStream; -void* objectImage2Create(tBinary cont, int *error) { /* use get like main.c */ +void* objectImage2Create(tBinary cont, int *error) { /* * This function will expand the data into an image structure, @@ -116,13 +116,16 @@ void* objectImage2Create(tBinary cont, int *error) { /* use get like main.c */ /* Expand graphic and check results */ *error=mExpandGraphic(cont,image); +printf("w=%d h=%d\n",image->width,image->height); if (*error==PR_RESULT_F_COMPRESS_RESULT_FATAL) { free(image); return NULL; } - if (getCarry(image->type) != 1 ) printf("error, monochrome palette fromat wrong\n"); + if (getCarry(image->type) != 1 ) printf("error, monochrome palette fromat wrong\n"); /* TODO: add a warning */ + + image->colorCount=2; return (void*)image; }