Index: trunk/stac/src/stacTransform.c
===================================================================
--- trunk/stac/src/stacTransform.c	(revision 9740)
+++ trunk/stac/src/stacTransform.c	(revision 12744)
@@ -193,4 +193,8 @@
         }
 
+        psImageInterpolateOptions *interp = psImageInterpolateOptionsAlloc(PS_INTERPOLATE_BILINEAR,
+                                                                           image, error, mask, 1, NAN, NAN,
+                                                                           1, 0, 0.0);
+
         // Iterate over the output image pixels
         for (int y = 0; y < outny; y++) {
@@ -204,13 +208,18 @@
 
                     // Change PS_INTERPOLATE_BILINEAR to best available technique.
-                    outImage->data.F32[y][x] = (psF32)psImagePixelInterpolate(image, detector->x,
-                                                                              detector->y, mask, 1, NAN,
-                                                                              PS_INTERPOLATE_BILINEAR);
+                    double imageValue, varianceValue;
+                    if (!psImageInterpolate(&imageValue, &varianceValue, NULL,
+                                            detector->x, detector->y, interp)) {
+                        psError(PS_ERR_UNKNOWN, false, "Unable to interpolate image.");
+                        psFree(interp);
+                        psFree(detector);
+                        psFree(sky);
+                        return false;
+                    }
+                    outImage->data.F32[y][x] = imageValue;
+
                     if (error) {
                         // Error is actually the variance
-                        outError->data.F32[y][x] = (psF32)p_psImageErrorInterpolateBILINEAR_F32(error,
-                                                                                                detector->x,
-                                                                                                detector->y,
-                                                                                                mask, 1, NAN);
+                        outError->data.F32[y][x] = varianceValue;
                     }
 
@@ -224,4 +233,5 @@
             }
         } // Iterating over output pixels
+        psFree(interp);
 
     } // Iterating over images
