summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toolbin/bmpcmp.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/toolbin/bmpcmp.c b/toolbin/bmpcmp.c
index 3d047e546..e55864105 100644
--- a/toolbin/bmpcmp.c
+++ b/toolbin/bmpcmp.c
@@ -1255,7 +1255,8 @@ static void *psd_read(ImageReader *im,
1255 } 1255 }
1256 ptr += *span * h + 1; 1256 ptr += *span * h + 1;
1257 } else if (n == 3) { 1257 } else if (n == 3) {
1258 /* RGB */ 1258 /* RGB (reverse to get BGR) */
1259 ptr += 2;
1259 for (z = 0; z < n; z++) 1260 for (z = 0; z < n; z++)
1260 { 1261 {
1261 for (y = 0; y < h; y++) 1262 for (y = 0; y < h; y++)
@@ -1269,8 +1270,9 @@ static void *psd_read(ImageReader *im,
1269 ptr -= w*N + *span; 1270 ptr -= w*N + *span;
1270 line -= w; 1271 line -= w;
1271 } 1272 }
1272 ptr += *span * h + 1; 1273 ptr += *span * h - 1;
1273 } 1274 }
1275 ptr += 4;
1274 for (y = 0; y < h; y++) 1276 for (y = 0; y < h; y++)
1275 { 1277 {
1276 for (x = 0; x < w; x++) 1278 for (x = 0; x < w; x++)
@@ -1320,7 +1322,8 @@ static void *psd_read(ImageReader *im,
1320 } 1322 }
1321 ptr += *span * h + 1; 1323 ptr += *span * h + 1;
1322 } else if (n == 3) { 1324 } else if (n == 3) {
1323 /* RGB */ 1325 /* RGB (reverse to get BGR) */
1326 ptr += 2;
1324 for (z = 0; z < n; z++) 1327 for (z = 0; z < n; z++)
1325 { 1328 {
1326 for (y = 0; y < h; y++) 1329 for (y = 0; y < h; y++)
@@ -1335,8 +1338,9 @@ static void *psd_read(ImageReader *im,
1335 ptr -= w*N + *span; 1338 ptr -= w*N + *span;
1336 line -= w*2; 1339 line -= w*2;
1337 } 1340 }
1338 ptr += *span * h + 1; 1341 ptr += *span * h - 1;
1339 } 1342 }
1343 ptr += 4;
1340 for (y = 0; y < h; y++) 1344 for (y = 0; y < h; y++)
1341 { 1345 {
1342 for (x = 0; x < w; x++) 1346 for (x = 0; x < w; x++)
@@ -2515,7 +2519,7 @@ static void untag_bmp(unsigned char *bmp,
2515 for (x = 0; x < w; x++) 2519 for (x = 0; x < w; x++)
2516 { 2520 {
2517 int R, G, B, T, r, g, b; 2521 int R, G, B, T, r, g, b;
2518 2522
2519 T = *bmp++; 2523 T = *bmp++;
2520 R = *bmp++; 2524 R = *bmp++;
2521 G = *bmp++; 2525 G = *bmp++;