about summary refs log tree commit diff
diff options
context:
space:
mode:
authorgiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-04-10 23:01:15 +0000
committergiraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8>2019-04-10 23:01:15 +0000
commit04be75d5e37d1604d41d4b1339b635e37dd2e5df (patch)
tree84eb3a7e5149fbe5c8d77e4844e5a978c7bb7108
parentd931c498be1345fbac654c1d0963b42cbce1649a (diff)
downloadnetpbm-mirror-04be75d5e37d1604d41d4b1339b635e37dd2e5df.tar.gz
netpbm-mirror-04be75d5e37d1604d41d4b1339b635e37dd2e5df.tar.xz
netpbm-mirror-04be75d5e37d1604d41d4b1339b635e37dd2e5df.zip
Fix -bgcolor
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@3593 9d0c8265-081b-0410-96cb-a4ca84ce46f8
-rw-r--r--doc/HISTORY5
-rw-r--r--editor/pnmcrop.c10
2 files changed, 7 insertions, 8 deletions
diff --git a/doc/HISTORY b/doc/HISTORY
index 4a8deb19..b4418713 100644
--- a/doc/HISTORY
+++ b/doc/HISTORY
@@ -6,9 +6,8 @@ CHANGE HISTORY
 
 not yet  BJH  Release 10.87.00
 
-              pnmcrop: fix bug: incorrect identification of background with
-              -bgcolor and PBM or PGM image.  Always present (-bgcolor was
-              introduced in Netpbm 10.86 (March 2019).
+              pnmcrop: fix bug: -bgcolor doesn't work.  Always present
+              (-bgcolor was introduced in Netpbm 10.86 (March 2019).
 
 19.03.30 BJH  Release 10.86.00
 
diff --git a/editor/pnmcrop.c b/editor/pnmcrop.c
index 3f414e1b..ba8e9090 100644
--- a/editor/pnmcrop.c
+++ b/editor/pnmcrop.c
@@ -450,7 +450,9 @@ backgroundColor(FILE *         const ifP,
    *ifP, which is described by 'cols', 'rows', 'maxval', and 'format'.
 
    'backgroundChoice' is the method we are to use in determining the
-   background color.
+   background color.  'colorName' is the color we are to assume is
+   background in the case that 'backgroundChoice' says to use a particular
+   color and meangingless otherwise.
 
    Expect the file to be positioned to the start of the raster, and leave
    it positioned arbitrarily.
@@ -465,7 +467,8 @@ backgroundColor(FILE *         const ifP,
         background = pnm_blackxel(maxval, format);
         break;
     case BG_COLOR:
-        backgroundColorFmName(colorName, maxval, format);
+        background =
+            backgroundColorFmName(colorName, maxval, format);
         break;
     case BG_SIDES:
         background =
@@ -479,9 +482,6 @@ backgroundColor(FILE *         const ifP,
         background =
             background1Corner(ifP, rows, cols, maxval, format, corner);
         break;
-
-    default:
-        pm_error("internal error");
     }
 
     return background;