diff options
| author | Freeimage <freeimage@aliceadsl.fr> | 2006-02-04 18:39:46 +0000 |
|---|---|---|
| committer | Freeimage <freeimage@aliceadsl.fr> | 2006-02-04 18:39:46 +0000 |
| commit | f31d963a643a0541ccbe47e119567aa3692c2f9d (patch) | |
| tree | 4d98960246452eb12d094b7376f401ff7cfa5509 /codec | |
| parent | 5e0948c142e9926d1730e9bccceeae96fff29c12 (diff) | |
fixed a bug in codec/convert.c::imagetobmp
Diffstat (limited to 'codec')
| -rw-r--r-- | codec/convert.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/codec/convert.c b/codec/convert.c index 5e4d9bf1..8be7c220 100644 --- a/codec/convert.c +++ b/codec/convert.c @@ -596,24 +596,24 @@ int imagetobmp(opj_image_t * image, char *outfile) { fprintf(fdest, "%c%c%c%c", (7834) & 0xff, ((7834) >> 8) & 0xff, ((7834) >> 16) & 0xff, ((7834) >> 24) & 0xff); fprintf(fdest, "%c%c%c%c", (256) & 0xff, ((256) >> 8) & 0xff, ((256) >> 16) & 0xff, ((256) >> 24) & 0xff); fprintf(fdest, "%c%c%c%c", (256) & 0xff, ((256) >> 8) & 0xff, ((256) >> 16) & 0xff, ((256) >> 24) & 0xff); - } - for (i = 0; i < 256; i++) { - fprintf(fdest, "%c%c%c%c", i, i, i, 0); - } + for (i = 0; i < 256; i++) { + fprintf(fdest, "%c%c%c%c", i, i, i, 0); + } - for (i = 0; i < wr * hr; i++) { - /* a modifier !! */ - /* fprintf(fdest, "%c", image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]); */ - fprintf(fdest, "%c", image->comps[0].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]); - /*if (((i + 1) % w == 0 && w % 2)) - fprintf(fdest, "%c", 0); */ - if ((i + 1) % wr == 0) { - for (pad = wr % 4 ? 4 - wr % 4 : 0; pad > 0; pad--) /* ADD */ - fprintf(fdest, "%c", 0); + for (i = 0; i < wr * hr; i++) { + /* a modifier !! */ + /* fprintf(fdest, "%c", image->comps[0].data[w * h - ((i) / (w) + 1) * w + (i) % (w)]); */ + fprintf(fdest, "%c", image->comps[0].data[w * hr - ((i) / (wr) + 1) * w + (i) % (wr)]); + /*if (((i + 1) % w == 0 && w % 2)) + fprintf(fdest, "%c", 0); */ + if ((i + 1) % wr == 0) { + for (pad = wr % 4 ? 4 - wr % 4 : 0; pad > 0; pad--) /* ADD */ + fprintf(fdest, "%c", 0); + } } + fclose(fdest); } - fclose(fdest); return 0; } |
