libtiff: One more regression fix.

https://github.com/libsdl-org/libtiff/commit/44670916e9b8fb3a628c52a653b57ec50bf65e4f

From 44670916e9b8fb3a628c52a653b57ec50bf65e4f Mon Sep 17 00:00:00 2001
From: Lee Howard <[EMAIL REDACTED]>
Date: Tue, 4 Jan 2011 02:51:17 +0000
Subject: [PATCH] One more regression fix.

---
 ChangeLog          | 4 ++--
 libtiff/tif_jpeg.c | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1fbac28e..6e2c7cd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,7 +1,7 @@
 2011-01-03  Lee Howard <faxguy@howardsilvan.com>
 
-	* libtiff/tif_jpeg.c: Fix regression with 3 band image caused by
-	commit on 2010-12-14 submitted by e-mail from 
+	* libtiff/tif_jpeg.c: Fix regressions with 2 and 3 band images
+	caused by commit on 2010-12-14.  Submitted by e-mail from 
 	Even Rouault <even.rouault@mines-paris.org>
 
 2010-12-31  Olivier Paquet  <olivier.paquet@gmail.com>
diff --git a/libtiff/tif_jpeg.c b/libtiff/tif_jpeg.c
index 3abeb6b2..7fc3e959 100644
--- a/libtiff/tif_jpeg.c
+++ b/libtiff/tif_jpeg.c
@@ -1,4 +1,4 @@
-/* $Id: tif_jpeg.c,v 1.50.2.16 2011-01-04 02:42:46 faxguy Exp $ */
+/* $Id: tif_jpeg.c,v 1.50.2.17 2011-01-04 02:51:17 faxguy Exp $ */
 
 /*
  * Copyright (c) 1994-1997 Sam Leffler
@@ -1358,7 +1358,7 @@ JPEGPreEncode(TIFF* tif, tsample_t s)
 			sp->cinfo.c.comp_info[0].h_samp_factor = sp->h_sampling;
 			sp->cinfo.c.comp_info[0].v_samp_factor = sp->v_sampling;
 		} else {
-			if (td->td_photometric == PHOTOMETRIC_MINISWHITE || td->td_photometric == PHOTOMETRIC_MINISBLACK)
+			if ((td->td_photometric == PHOTOMETRIC_MINISWHITE || td->td_photometric == PHOTOMETRIC_MINISBLACK) && td->td_samplesperpixel == 1)
 				sp->cinfo.c.in_color_space = JCS_GRAYSCALE;
 			else if (td->td_photometric == PHOTOMETRIC_RGB)
 				sp->cinfo.c.in_color_space = JCS_RGB;