projects
/
openjpeg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1f7520c
)
BMP problem solves : BMP-Images with dimension multiple of 4 presented problems
author
Yannick Verschueren
<unknown@unknown>
Mon, 15 Mar 2004 10:42:29 +0000
(10:42 +0000)
committer
Yannick Verschueren
<unknown@unknown>
Mon, 15 Mar 2004 10:42:29 +0000
(10:42 +0000)
codec/convert.c
patch
|
blob
|
history
diff --git
a/codec/convert.c
b/codec/convert.c
index 48b9d18a55f647b0493eae23ce2debfb168f6518..4697ed818889acd925e256e124731e361b8e6491 100644
(file)
--- 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));