diff options
| author | Yannick Verschueren <unknown@unknown> | 2004-03-15 10:42:29 +0000 |
|---|---|---|
| committer | Yannick Verschueren <unknown@unknown> | 2004-03-15 10:42:29 +0000 |
| commit | e5106dd836a820b91402c1efd6640e0b7d0e763c (patch) | |
| tree | 4c315e67466777758b36efb5cfe9bb006c17df8f /codec/convert.c | |
| parent | 1f7520c88bebce9f3c2c91c8b3e9be562ef44927 (diff) | |
BMP problem solves : BMP-Images with dimension multiple of 4 presented problems
Diffstat (limited to 'codec/convert.c')
| -rw-r--r-- | codec/convert.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/codec/convert.c b/codec/convert.c index 48b9d18a..4697ed81 100644 --- a/codec/convert.c +++ b/codec/convert.c @@ -203,7 +203,10 @@ int bmptoimage(char *filename, j2k_image_t * img, int subsampling_dx, int subsam W = Info_h.biWidth; H = Info_h.biHeight; - PAD = 4 - (3 * W) % 4; + // PAD = 4 - (3 * W) % 4; + // PAD = (PAD == 4) ? 0 : PAD; + PAD = (3 * W) % 4 ? 4 - (3 * W) % 4 : 0; + RGB = (unsigned char *) malloc((3 * W + PAD) * H * sizeof(unsigned char)); |
