Index: trunk/psModules/src/imcombine/pmImageCombine.c
===================================================================
--- trunk/psModules/src/imcombine/pmImageCombine.c	(revision 11115)
+++ trunk/psModules/src/imcombine/pmImageCombine.c	(revision 12742)
@@ -8,6 +8,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2007-01-16 23:51:51 $
+ *  @version $Revision: 1.12 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2007-04-04 22:42:48 $
  *
  *  XXX: pmRejectPixels() has a known bug with the pmImageTransform() call.
@@ -375,8 +375,8 @@
 image, this routine determines the size of the input image which maps to that
 image, and returns the result in a psRegion struct.
- 
+
 XXX: Basically, this routine is only guaranteed to work if the transform is
 linear.
- 
+
 XXX: Shouldn't this functionality be part of psImageTransform()?
  *****************************************************************************/
@@ -491,5 +491,5 @@
 pmRejectPixels(images, errors, inToOut, outToIn, rejThreshold,
 gradLimit)
- 
+
 XXX: Optimization: we don't need to transform the entire mask image.
 XXX: The inToOut and outToIn transforms are confusing.  Verify that what
@@ -591,10 +591,25 @@
         // in other images.
         //
+
+        psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR,
+                                                                           transformedImage, NULL, NULL,
+                                                                           0, 0.0, 0.0, 0, 0, 0.0);
+
         for (psS32 p = 0 ; p < pixelList->n ; p++) {
             inCoords->x = 0.5 + (psF32) (pixelList->data[p]).x;
             inCoords->y = 0.5 + (psF32) (pixelList->data[p]).y;
             psPlaneTransformApply(outCoords, myInToOut, inCoords);
-            psF32 maskVal = (psF32) psImagePixelInterpolate(transformedImage, outCoords->x, outCoords->y,
-                            NULL, 0, 0.0, PS_INTERPOLATE_BILINEAR);
+            double maskVal;
+            if (!psImageInterpolate(&maskVal, NULL, NULL, outCoords->x, outCoords->y, interp)) {
+                psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
+                psFree(interp);
+                psFree(maskImage);
+                psFree(maskImageF32);
+                psFree(transformedImage);
+                psFree(inCoords);
+                psFree(outCoords);
+                psFree(rejects);
+                return NULL;
+            }
             if (maskVal > rejThreshold) {
 
@@ -656,4 +671,5 @@
         }
 
+        psFree(interp);
         psFree(maskImage);
         psFree(maskImageF32);
