Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-26 Thread Federico Mena Quintero

Larry Ewing <[EMAIL PROTECTED]> writes:

> hasn't timj complained loudly about how broken the code in
> gdk_pixbuf_get_from_drawable is?  Of course the code he wrote for the
> desk guide likes to segfault, so who knows.

Yeah, the function in the stable branch has a number of race
conditions that will bite you if you are doing scary stuff on windows
that you do not control :)

I *think* it has been fixed in GTK+ 1.3, but I am not sure.

  Federico
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-26 Thread Sven Neumann

Hi,

Federico Mena Quintero <[EMAIL PROTECTED]> writes:

> > I've had this problem, and it appears to exist only with the version of
> > xwd that's shipped with XFree86 4.0.x where x<=2. I upgraded to 4.0.3
> > and the problem went away. Same problem (with same version of X) existed
> > with WindowMaker too.
> 
> Oh dear.  Don't tell me that the GIMP uses xwd for getting
> screenshots.  If so, please please *please* feel free to steal the
> code from gdk_pixbuf_get_from_drawable().

it does ;-)

The screenshot plug-in is kind of old and has always been a quick hack.
On the other hand it works pretty well for most users... Yes, we are 
considering another solution for the next version of Gimp. Since we will
use GTK+-2.0, we will also use gdk-pixbuf and can thus use the 
functionality gdk-pixbuf provides. For Gimp-1.2 however things will not 
change.


Salut, Sven
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-26 Thread Larry Ewing

On 25 Jun 2001 20:17:44 -0500, Federico Mena Quintero wrote:
> Dave Neary <[EMAIL PROTECTED]> writes:
> 
> > >  #51358  Acquire-screenshot not working with enlightenment
> > >  http://bugzilla.gnome.org/show_bug.cgi?id=51358
> > >I'm sure it's enlightenments fault ;-) Perhaps we can do something
> > >about it anyway...
> > 
> > I've had this problem, and it appears to exist only with the version of
> > xwd that's shipped with XFree86 4.0.x where x<=2. I upgraded to 4.0.3
> > and the problem went away. Same problem (with same version of X) existed
> > with WindowMaker too.
> 
> Oh dear.  Don't tell me that the GIMP uses xwd for getting
> screenshots.  If so, please please *please* feel free to steal the
> code from gdk_pixbuf_get_from_drawable().
> 
>   Federico

hasn't timj complained loudly about how broken the code in
gdk_pixbuf_get_from_drawable is?  Of course the code he wrote for the
desk guide likes to segfault, so who knows.

--Larry
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-26 Thread Federico Mena Quintero

Dave Neary <[EMAIL PROTECTED]> writes:

> >  #51358  Acquire-screenshot not working with enlightenment
> >  http://bugzilla.gnome.org/show_bug.cgi?id=51358
> >I'm sure it's enlightenments fault ;-) Perhaps we can do something
> >about it anyway...
> 
> I've had this problem, and it appears to exist only with the version of
> xwd that's shipped with XFree86 4.0.x where x<=2. I upgraded to 4.0.3
> and the problem went away. Same problem (with same version of X) existed
> with WindowMaker too.

Oh dear.  Don't tell me that the GIMP uses xwd for getting
screenshots.  If so, please please *please* feel free to steal the
code from gdk_pixbuf_get_from_drawable().

  Federico
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-20 Thread Dave Neary

Dave Neary wrote:
> 
> I did think that an integer constant 0 could be used in a pointer context 
> without a cast, though...

Hi all,

I've confirmed that this code (for the case where the enum value passed
is 0) should work in any ANSI conforming compiler (according to the
impressarios of comp.lang.c anyway). Whether it's wise to do this is
another matter, but in this case it's the compiler that's broken.

Cheers,
Dave.

-- 
David Neary,   E-Mail [EMAIL PROTECTED]
Palamon Technologies Ltd.  Phone +353-1-634-5059
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-20 Thread Dave Neary

Sven Neumann wrote:
> 
> Hi,
>
> I'll look into fixing this later or wait for a patch. Please report if
> you find more of these.

Patch attached. If I find any more I'll let you know... I did think that
an integer constant 0 could be used in a pointer context without a cast,
though...

> Salut, Sven

Cheers,
Dave.

PS. I forgot the patch the last time...

-- 
David Neary,   E-Mail [EMAIL PROTECTED]
Palamon Technologies Ltd.  Phone +353-1-634-5059

? GINT_TO_POINTER.patch
Index: app/histogram_tool.c
===
RCS file: /cvs/gnome/gimp/app/Attic/histogram_tool.c,v
retrieving revision 1.40.2.1
diff -u -r1.40.2.1 histogram_tool.c
--- app/histogram_tool.c2001/05/06 21:15:05 1.40.2.1
+++ app/histogram_tool.c2001/06/20 11:05:43
@@ -227,9 +227,15 @@
   /* Channels can only have value histograms; reconfigure channel menu. */
   /* Note: gimp_histogram_get_mean() in gimphistogram.c. garo 5/7/2001  */ 
   histogram_tool_dialog->channel = GIMP_HISTOGRAM_VALUE;
-  gimp_option_menu_set_history (g_list_nth_data (gtk_container_children 
(GTK_CONTAINER (histogram_tool_dialog->channel_menu)), 1), GIMP_HISTOGRAM_VALUE);
+  gimp_option_menu_set_history (g_list_nth_data 
+   (gtk_container_children 
+(GTK_CONTAINER 
+ (histogram_tool_dialog->channel_menu)), 
+1), 
+   GINT_TO_POINTER (GIMP_HISTOGRAM_VALUE));
   gtk_widget_hide (histogram_tool_dialog->channel_menu);
-  histogram_tool_gradient_draw (histogram_tool_dialog->gradient, 
GIMP_HISTOGRAM_VALUE);
+  histogram_tool_gradient_draw (histogram_tool_dialog->gradient, 
+   GIMP_HISTOGRAM_VALUE);
 }
 
   /* calculate the histogram */



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-20 Thread Sven Neumann

Hi,

Dave Neary <[EMAIL PROTECTED]> writes:

> I couldn't build gimp 1.2 (with gcc 2.96 - RedHat's 7.0 prerelease) for
> the first time recently because of the following line in
> app/histogram_tool.c:
> Line 230:
>   gimp_option_menu_set_history (g_list_nth_data
> (gtk_container_children 
>   (GTK_CONTAINER (histogram_tool_dialog->channel_menu)), 1), 
>   GIMP_HISTOGRAM_VALUE);
> 
> The prototype for gimp_option_menu_set_history is 
> void  gimp_option_menu_set_history (GtkOptionMenu  *option_menu,
>   gpointeruser_data);
> and GIMP_HISTOGRAM_VALUE is an enum value equal to 0. The problem is
> hidden with a cast to gpointer.

the code is subtly wrong. Integers (thus enums) should always be casted
using GINT_TO_POINTER() before passing them as user_data. The callback
function then has to use GPOINTER_TO_INT(). Usually these macros do
nothing but cast to (void *) and (int) respectively, but an explicit
cast should be enough here to make your compiler happy.

I'll look into fixing this later or wait for a patch. Please report if 
you find more of these.


Salut, Sven
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-20 Thread Sven Neumann

Hi,

"Branko Collin" <[EMAIL PROTECTED]> writes:

> Also I noticed that when saving TIFFs, sometimes the 'hard coded' 
> comment is used, sometimes the one I supplied in the preferences. The 
> difference seems to be between images that I acquired from the 
> Windows clipboard and images that I started with /New. Is that 
> at all possible? 

Yes, it's exactly the problem described in the bug-report. Gimp does 
only attach a gimp-comment parasite to an image if it is created using
File->New. Other ways to create an image (Paste as New, Screenshot, 
Clipboard) do not attach the default comment. If you save an image that
has no comment parasite attached, the save plug-ins use their hardcoded
value.

If we'd fix this by making gimp_image_new() attach a default comment 
parasite (just like it sets the default resolution), all images touched
by The GIMP would get the default comment unless they already have a 
comment and the respective load plug-in takes care of setting it as a
parasite.

Another way to fix this is to change places like Paste as New, 
Screenshot, Clipboard etc. where images are created and let them take
care of attaching the default comment.

I don't consider this problem serious enough to insist on having it
fixed in 1.2. If it turns out that there is no simple solution, we'll
tackle this problem in the 1.3 tree.


Salut, Sven





___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-20 Thread Dave Neary

Sven Neumann wrote:
> 
> Hi,
> 
> went out for some bug-hinting in the 1.2 wilderness tonight and came
> up with this list of beasts that are still alive and should be killed
> in 1.2 if possible:

Speaking of bug-hunting...

I couldn't build gimp 1.2 (with gcc 2.96 - RedHat's 7.0 prerelease) for
the first time recently because of the following line in
app/histogram_tool.c:
Line 230:
  gimp_option_menu_set_history (g_list_nth_data
(gtk_container_children 
(GTK_CONTAINER (histogram_tool_dialog->channel_menu)), 1), 
GIMP_HISTOGRAM_VALUE);

The prototype for gimp_option_menu_set_history is 
void  gimp_option_menu_set_history (GtkOptionMenu  *option_menu,
gpointeruser_data);
and GIMP_HISTOGRAM_VALUE is an enum value equal to 0. The problem is
hidden with a cast to gpointer.

My question is whether this is a compiler bug, or whether a constant 0
is valid as a gpointer value? Does this problem show up in the shiny new
gcc 3.0? Is it a case of just upgrading the compiler?

Cheers,
Dave.

-- 
David Neary,   E-Mail [EMAIL PROTECTED]
Palamon Technologies Ltd.  Phone +353-1-634-5059
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-20 Thread Branko Collin

On 20 Jun 2001, at 10:27, Dave Neary wrote:
> Sven Neumann wrote:

> >  #51164  Default image comment not set correctly
> >  http://bugzilla.gnome.org/show_bug.cgi?id=51164
> >I've added some comments on how one could be fixed to the report.
> >Not sure what is the correct fix for this. Comments?
> 
> The default "Made with the GIMP" comment is hard coded into
> plug-ins/common/xbm.c - and presumably into the others too. It seems
> to me that the easiest solution would be to include gtkrc in the
> relevant plug-ins, and do a read on the gimprc when loading the
> plug-ins.

This is what I could find. I am not a programmer, however, and may be 
mistaken about which strings do get gettexted and which do not.

Made with ...

plug-ins/common/gtm.c

Created with ...

plug-ins/common/csource.c
plug-ins/common/jpeg.c
plug-ins/common/tiff.c

xbm.c, however, does seem to use gettext:

  INIT_I18N_UI();
  strncpy (xsvals.comment, _("Created with The GIMP"), MAX_COMMENT);

Also I noticed that when saving TIFFs, sometimes the 'hard coded' 
comment is used, sometimes the one I supplied in the preferences. The 
difference seems to be between images that I acquired from the 
Windows clipboard and images that I started with /New. Is that 
at all possible? I will do some more testing.

(HTH)

-- 
branko collin
[EMAIL PROTECTED]
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-20 Thread Austin Donnelly

On Wednesday, 20 Jun 2001, Dave Neary wrote:

> The default "Made with the GIMP" comment is hard coded into
> plug-ins/common/xbm.c - and presumably into the others too. It seems to
> me that the easiest solution would be to include gtkrc in the relevant
> plug-ins, and do a read on the gimprc when loading the plug-ins.

No.  These plugins are sufficiently old that they pre-date parasites.
The correct thing to do is ensure that images have the right
"gimp-comment" parasite, and make all the plugins looks at it.

In the same way as freshly created images are defaulted to 72 dpi,
maybe they should also have a "gimp-comment" parasite added.  File
load plugins would then just override the parasite if the file format
includes a more specific parasite.  I believe current file load
plugins than know about parasites wouldn't need modification.

Austin
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer



Re: [Gimp-developer] 1.2 Bug Hunting

2001-06-20 Thread Dave Neary

Sven Neumann wrote:
> 
> Hi,
> 
> went out for some bug-hinting in the 1.2 wilderness tonight and came
> up with this list of beasts that are still alive and should be killed
> in 1.2 if possible:
>
>  #51358  Acquire-screenshot not working with enlightenment
>  http://bugzilla.gnome.org/show_bug.cgi?id=51358
>I'm sure it's enlightenments fault ;-) Perhaps we can do something
>about it anyway...

I've had this problem, and it appears to exist only with the version of
xwd that's shipped with XFree86 4.0.x where x<=2. I upgraded to 4.0.3
and the problem went away. Same problem (with same version of X) existed
with WindowMaker too.

>  #51164  Default image comment not set correctly
>  http://bugzilla.gnome.org/show_bug.cgi?id=51164
>I've added some comments on how one could be fixed to the report.
>Not sure what is the correct fix for this. Comments?

The default "Made with the GIMP" comment is hard coded into
plug-ins/common/xbm.c - and presumably into the others too. It seems to
me that the easiest solution would be to include gtkrc in the relevant
plug-ins, and do a read on the gimprc when loading the plug-ins.

Cheers,
Dave.

-- 
David Neary,   E-Mail [EMAIL PROTECTED]
Palamon Technologies Ltd.  Phone +353-1-634-5059
___
Gimp-developer mailing list
[EMAIL PROTECTED]
http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer