about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/HISTORY3
-rw-r--r--editor/pnmshear.c7
2 files changed, 7 insertions, 3 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 08411a79..ab9dd377 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -39,6 +39,9 @@ not yet  BJH  Release 10.65.00
               pbmtoepsi: fix excessively long raster line.  Always broken.
               Thanks Prophet of the Way <afu@wta.att.ne.jp>.
 
+              pnmshear: fix incorrect determination of background color.
+              Always broken.
+
               ppmpat: fix crash with -squig with aspect ratio < 1:25 or
               > 25:1. Thanks Prophet of the Way <afu@wta.att.ne.jp>.
               Always broken.
diff --git a/editor/pnmshear.c b/editor/pnmshear.c
index 6318f8e4..657f265d 100644
--- a/editor/pnmshear.c
+++ b/editor/pnmshear.c
@@ -241,14 +241,15 @@ main(int argc, char * argv[]) {
     pnm_writepnminit(stdout, newcols, rows, newmaxval, newformat, 0);
     newxelrow = pnm_allocrow(newcols);
     
-    bgxel = backgroundColor(cmdline.background, xelrow, cols, newmaxval,
-                            format);
-
     for (row = 0; row < rows; ++row) {
         double shearCols;
 
         pnm_readpnmrow(ifP, xelrow, cols, newmaxval, format);
 
+        if (row == 0)
+            bgxel = backgroundColor(cmdline.background,
+                                    xelrow, cols, newmaxval, format);
+
         if (cmdline.angle > 0.0)
             shearCols = row * shearfac;
         else