Index: /trunk/psLib/src/imageops/psImageUnbin.c
===================================================================
--- /trunk/psLib/src/imageops/psImageUnbin.c	(revision 21035)
+++ /trunk/psLib/src/imageops/psImageUnbin.c	(revision 21036)
@@ -7,6 +7,6 @@
  *  @author Eugene Magnier, IfA
  *
- *  @version $Revision: 1.9 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2008-11-17 02:38:43 $
+ *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2008-12-18 21:02:30 $
  *
  *  Copyright 2007 Institute for Astronomy, University of Hawaii
@@ -267,7 +267,10 @@
     const double y = yIn - in->row0;
 
-    // allow extrapolation one pixel beyong edge of valid pixels, but no further
-    // (this allows the nXskip,nYskip boundary areas to be used as well)
-    if ((x < -1) || (x > in->numCols) || (y < -1) || (y > in->numRows)) {
+    // allow extrapolation a small distance beyond the edge of valid pixels, but no
+    // further (this allows the nXskip,nYskip boundary areas to be used as well)
+    int nXedge = 0.125*in->numCols;
+    int nYedge = 0.125*in->numRows;
+
+    if ((x < -nXedge) || (x > in->numCols + nXedge) || (y < -nYedge) || (y > in->numRows + nYedge)) {
         psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Point (%f,%f) lies outside binned image", x, y);
         return NAN;
