summaryrefslogtreecommitdiff
path: root/toolbin/bmpcmp.c
diff options
context:
space:
mode:
authorRobin Watts <Robin.Watts@artifex.com>2019-08-21 17:49:32 +0100
committerRobin Watts <Robin.Watts@artifex.com>2019-08-21 17:50:34 +0100
commit079ea7d9e0c713a7834fc8f08d52ce42e6a03666 (patch)
tree771f36ef51a0355f43d75f176cded498d19f138e /toolbin/bmpcmp.c
parent935408d6205742e40471b18d7f0f1fe4febc437c (diff)
downloadghostpdl-079ea7d9e0c713a7834fc8f08d52ce42e6a03666.tar.gz
Update bmpcmp.c to read psdrgb rather than psdbgr.
Diffstat (limited to 'toolbin/bmpcmp.c')
-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,
}
ptr += *span * h + 1;
} else if (n == 3) {
- /* RGB */
+ /* RGB (reverse to get BGR) */
+ ptr += 2;
for (z = 0; z < n; z++)
{
for (y = 0; y < h; y++)
@@ -1269,8 +1270,9 @@ static void *psd_read(ImageReader *im,
ptr -= w*N + *span;
line -= w;
}
- ptr += *span * h + 1;
+ ptr += *span * h - 1;
}
+ ptr += 4;
for (y = 0; y < h; y++)
{
for (x = 0; x < w; x++)
@@ -1320,7 +1322,8 @@ static void *psd_read(ImageReader *im,
}
ptr += *span * h + 1;
} else if (n == 3) {
- /* RGB */
+ /* RGB (reverse to get BGR) */
+ ptr += 2;
for (z = 0; z < n; z++)
{
for (y = 0; y < h; y++)
@@ -1335,8 +1338,9 @@ static void *psd_read(ImageReader *im,
ptr -= w*N + *span;
line -= w*2;
}
- ptr += *span * h + 1;
+ ptr += *span * h - 1;
}
+ ptr += 4;
for (y = 0; y < h; y++)
{
for (x = 0; x < w; x++)
@@ -2515,7 +2519,7 @@ static void untag_bmp(unsigned char *bmp,
for (x = 0; x < w; x++)
{
int R, G, B, T, r, g, b;
-
+
T = *bmp++;
R = *bmp++;
G = *bmp++;