$OpenBSD: patch-modules_gsane_gsane-processor_c,v 1.1 2010/04/24 18:21:49 ajacoutot Exp $
--- modules/gsane/gsane-processor.c.orig	Sat Nov  7 11:01:09 2009
+++ modules/gsane/gsane-processor.c	Sat Apr 24 20:03:49 2010
@@ -22,6 +22,7 @@
 #include "gsane-processor.h"
 #include <string.h>
 #include <math.h>
+#include <config.h>
 
 typedef void (*GSaneProcessorFunc) (GSaneProcessor *self, guchar *buf, guint buf_len);
 
@@ -118,7 +119,11 @@ gsane_processor_process_nbit(GSaneProcessor *self, guc
 				   operation */
 	guint src_pos;
 	guint offset;
+#if !ENABLE_GEGL_010	
 	guchar *src, *dest, *buf8 = g_new0(guchar, self->priv->pixels_in_buf * self->priv->format->format.bytes_per_pixel);
+#else
+	guchar *src, *dest, *buf8 = g_new0(guchar, self->priv->pixels_in_buf * babl_format_get_bytes_per_pixel(self->priv->format));
+#endif
 	guint samples_in_buf = self->priv->pixels_in_buf * self->priv->sample_count;
 	for (i = 0 ; i < samples_in_buf ; i++) {
 		/* compute the address of the first byte container sample value */
@@ -180,7 +185,11 @@ gsane_processor_process_three_pass_8bit(GSaneProcessor
 		/* pos of pixel i in buf */
 		src_pos = i * self->priv->bytes_per_pixel;
 		/* pos of pixel i in buf3 */
+#if !ENABLE_GEGL_010
 		dest_pos = i * self->priv->format->format.bytes_per_pixel + self->priv->sample_offset;
+#else
+		dest_pos = i * babl_format_get_bytes_per_pixel(self->priv->format) + self->priv->sample_offset;
+#endif
 		/* save */
 		memcpy(buf3+dest_pos, buf+src_pos, self->priv->bytes_per_pixel);
 	}
@@ -368,7 +377,11 @@ gsane_processor_prepare_image(GSaneProcessor *self, SA
 	self->priv->format = gsane_processor_get_babl_format(self);
 	g_return_val_if_fail(self->priv->format, NULL);
 
+#if !ENABLE_GEGL_010
 	self->priv->sample_stride	= self->priv->format->format.bytes_per_pixel / MAX(self->priv->sample_count, self->priv->frame_count);
+#else
+	self->priv->sample_stride       = babl_format_get_bytes_per_pixel(self->priv->format) / MAX(self->priv->sample_count, self->priv->frame_count);
+#endif
 	self->priv->max_target_sample_value= (0xFFFFFFFF) >> (32 - self->priv->sample_stride * 8);
 
 	self->priv->buffer = gegl_buffer_new(&extent, self->priv->format);
