Submitting a fix

2000-12-18 Thread David Neary


Hi all,

I've fixed a bug (bug #9156), but I don't know how to go about
submitting the fix (making a diff file, where to send it, that kind of
thing) - can someone point me to a page that explains it, or should I
post it here? It's a one-line fix...

Cheers,
Dave.

-- 
Dave Neary,
Software engineer, Informix Dublin.
Ireland.
Phone: +353-1-409-1357



Re: Submitting a fix

2000-12-18 Thread David Neary

Austin Donnelly wrote:
 
 Oh, go on - you know you want to!

:) Alright, I will...

The fix I put in (under certain unusual circumstances) has the potential
for bad behaviour - you'll get a memset(mask, 0, 0). I'm not sure what
that'd do.

To eliminate any risk of it (I should have done this the first time),
the following fix is a bit better... Sorry for the mess!

Dave.

 Austin

-- 
Dave Neary,
Software engineer, Informix Dublin.
Ireland.
Phone: +353-1-409-1357

Index: ifscompose.c
===
RCS file: /cvs/gnome/gimp/plug-ins/ifscompose/ifscompose.c,v
retrieving revision 1.36
diff -u -r1.36 ifscompose.c
--- ifscompose.c2000/11/27 10:35:23 1.36
+++ ifscompose.c2000/12/18 18:14:53
@@ -1354,7 +1354,11 @@
 
   num_bands = ceil((gdouble)(width*height*SQR(ifsvals.subdivide)*5)
   / (1024 * ifsvals.max_memory));
-  band_height = height / num_bands;
+  band_height = (height + num_bands - 1)/ num_bands) ; 
+  /* For bug #9156 - adding 1 guarantees that 
+   * band_height*num_bands = height  (band_height-1)*num_bands
+   * band_height automatically got rounded down, resulting in a diff 
+   * of a few pixels when num_bands didn't divide evenly */ 
   if (band_height  height)
 band_height = height;
 



Re: Submitting a fix

2000-12-18 Thread David Neary

David Neary wrote:
 
 To eliminate any risk of it (I should have done this the first time),
 the following fix is a bit better... Sorry for the mess!

... and of course, the comment should have been changed from "adding 1"
to "adding num_bands - 1 to height".

Again, many apologies for the error - I'm sure I'll do better next time
:)

Cheers,
Dave.

   
 Index: ifscompose.c
 ===
 RCS file: /cvs/gnome/gimp/plug-ins/ifscompose/ifscompose.c,v
 retrieving revision 1.36
 diff -u -r1.36 ifscompose.c
 --- ifscompose.c2000/11/27 10:35:23 1.36
 +++ ifscompose.c2000/12/18 18:14:53
 @@ -1354,7 +1354,11 @@
 
num_bands = ceil((gdouble)(width*height*SQR(ifsvals.subdivide)*5)
/ (1024 * ifsvals.max_memory));
 -  band_height = height / num_bands;
 +  band_height = (height + num_bands - 1)/ num_bands) ;
 +  /* For bug #9156 - adding 1 guarantees that
 +   * band_height*num_bands = height  (band_height-1)*num_bands
 +   * band_height automatically got rounded down, resulting in a diff
 +   * of a few pixels when num_bands didn't divide evenly */
if (band_height  height)
  band_height = height;
 

-- 
Dave Neary,
Software engineer, Informix Dublin.
Ireland.
Phone: +353-1-409-1357