Index: trunk/psLib/src/imageops/psImageConvolve.c
===================================================================
--- trunk/psLib/src/imageops/psImageConvolve.c	(revision 12187)
+++ trunk/psLib/src/imageops/psImageConvolve.c	(revision 12741)
@@ -7,6 +7,6 @@
 /// @author Eugene Magnier, IfA
 ///
-/// @version $Revision: 1.50 $ $Name: not supported by cvs2svn $
-/// @date $Date: 2007-03-02 22:19:21 $
+/// @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
+/// @date $Date: 2007-04-04 22:42:02 $
 ///
 /// Copyright 2004-2007 Institute for Astronomy, University of Hawaii
@@ -102,5 +102,5 @@
                            const psVector *xShifts,
                            const psVector *yShifts,
-                           bool tRelative,
+                           float totalTime,
                            bool xyRelative)
 {
@@ -113,4 +113,9 @@
     PS_ASSERT_VECTOR_TYPE(xShifts, PS_TYPE_S32, NULL);
     PS_ASSERT_VECTOR_TYPE(yShifts, PS_TYPE_S32, NULL);
+
+    if (isnan(totalTime)) {
+        // It's more expensive to check for NAN than 0.0
+        totalTime = 0.0;
+    }
 
     // If there are no shifts, the kernel is just a 1 at 0,0
@@ -153,5 +158,5 @@
         }
 
-        if (tRelative) {
+        if (totalTime <= 0) {
             tSum += tShifts->data.F32[i];
         }
@@ -160,8 +165,8 @@
     psTrace("psLib.imageops", 5, "Kernel range: %d:%d,%d:%d\n", xMin, xMax, yMin, yMax);
 
-    if (!tRelative) {
+    if (totalTime > 0) {
         // Then the total time is simply the final value
         // NB: We assume the counter starts at zero!
-        tSum = tShifts->data.F32[tShifts->n - 1];
+        tSum = totalTime;
     }
 
@@ -181,5 +186,5 @@
         }
         float t = tShifts->data.F32[i];
-        if (!tRelative) {
+        if (totalTime > 0) {
             t -= tLast;
             tLast = tShifts->data.F32[i];
