GNOME Bugzilla – Bug 315417
Gimp-Base-CRITCIAL when doing elipse selection
Last modified: 2005-09-07 10:18:47 UTC
I see this in the 'dots' gimp-perl script. The PDB trace is shown below, along with each step. I ran this on a new image of size 377x233 if that matters. DB<1> b 35 DB<2> c main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:35): 35: my($img,$layer,$size,$dotcolor,$opacity,$xspacing,$yspacing,$xoffset,$yoffset) =@_; DB<2> n main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:36): 36: my $has_noselection; DB<2> n main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:37): 37: $layer->is_layer || die "A layer is required for this plugin"; DB<2> n gimp_drawable_is_layer( DRAWABLE drawable=2 "The drawable" ) = ( INT32 layer=1 "Non-zero if the drawable is a layer" ) main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:39): 39: $yoffset = $yoffset % $yspacing; DB<2> n main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:40): 40: $xoffset = $xoffset % $xspacing; DB<2> n main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:42): 42: $img->undo_group_start; DB<2> n gimp_image_undo_group_start( IMAGE image=1 "The ID of the image in which to open an undo group" ) = ( ) main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:45): 45: @bounds = $img->selection_bounds; DB<2> n gimp_selection_bounds( IMAGE image=1 "The image" ) = ( INT32 non-empty=0 "True if there is a selection" INT32 x1=0 "x coordinate of upper left corner of selection bounds" INT32 y1=0 "y coordinate of upper left corner of selection bounds" INT32 x2=377 "x coordinate of lower right corner of selection bounds" INT32 y2=233 "y coordinate of lower right corner of selection bounds" ) main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:46): 46: if (!$bounds[0]) 47: { DB<2> n main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:48): 48: $img->selection_all; DB<2> n gimp_selection_all( IMAGE image=1 "The image" ) = ( ) main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:49): 49: $has_noselection=1; DB<2> n main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:51): 51: $selchannel = $img->selection_save; DB<2> n gimp_selection_save( IMAGE image=1 "The image" ) = ( CHANNEL channel=3 "The new channel" ) main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:54): 54: $img->selection_none; DB<2> n gimp_selection_none( IMAGE image=1 "The image" ) = ( ) main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:66): 66: } DB<2> n main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:55): 55: for ($x=$xoffset-$xspacing; 56: $x<$img->width+$size+$xspacing; 57: $x+=$xspacing) 58: { DB<2> n gimp_image_width( IMAGE image=1 "The image" ) = ( INT32 width=377 "The image's width" ) main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:65): 65: } DB<2> n main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:59): 59: for ($y=$yoffset-$yspacing; 60: $y<$img->height+$size+$yspacing; 61: $y+=$yspacing) 62: { DB<2> n gimp_image_height( IMAGE image=1 "The image" ) = ( INT32 height=233 "The image's height" ) main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:63): 63: $img->ellipse_select($x-0.5*$size,$y-0.5*$size, 64: $size,$size,CHANNEL_OP_ADD,1,0,0.0); DB<2> n gimp_ellipse_select( IMAGE image=1 "The image" FLOAT x=-19.000000 "x coordinate of upper-left corner of ellipse bounding box" FLOAT y=-13.000000 "y coordinate of upper-left corner of ellipse bounding box" FLOAT width=10.000000 "The width of the ellipse: 0 < width" FLOAT height=10.000000 "The height of the ellipse: 0 < height" INT32 operation=0 "The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }" INT32 antialias=1 "Antialiasing (TRUE or FALSE)" INT32 feather=0 "Feather option for selections" FLOAT feather-radius=0.000000 "Radius for feather operation" ) = ( ) gimp_image_height( IMAGE image=1 "The image" ) = ( INT32 height=233 "The image's height" ) main::CODE(0x83e47a0)(/usr/local/lib/gimp/2.0/plug-ins/dots:63): 63: $img->ellipse_select($x-0.5*$size,$y-0.5*$size, 64: $size,$size,CHANNEL_OP_ADD,1,0,0.0); DB<2> n gimp_ellipse_select( IMAGE image=1 "The image" FLOAT x=-19.000000 "x coordinate of upper-left corner of ellipse bounding box" FLOAT y=3.000000 "y coordinate of upper-left corner of ellipse bounding box" FLOAT width=10.000000 "The width of the ellipse: 0 < width" FLOAT height=10.000000 "The height of the ellipse: 0 < height" INT32 operation=0 "The selection operation: { GIMP_CHANNEL_OP_ADD (0), GIMP_CHANNEL_OP_SUBTRACT (1), GIMP_CHANNEL_OP_REPLACE (2), GIMP_CHANNEL_OP_INTERSECT (3) }" INT32 antialias=1 "Antialiasing (TRUE or FALSE)" INT32 feather=0 "Feather option for selections" FLOAT feather-radius=0.000000 "Radius for feather operation" ) = (gimp-2.3:19817): Gimp-Base-CRITICAL **: tile_manager_new: assertion `toplevel_width > 0' failed (gimp-2.3:19817): Gimp-Base-CRITICAL **: tile_manager_bpp: assertion `tm != NULL' failed (gimp-2.3:19817): Gimp-Base-CRITICAL **: tile_manager_get_memsize: assertion `tm != NULL' failed ( ) I don't see anything that immediately would tell me what triggers it. The end result seems to be correct. I may dig into this further, but wanted it recorded in case I don't.
It would probably help if you could attach the script so that we can try to reproduce the problem. It would also be interesting to know if the problem only shows up with the CVS version or also with GIMP 2.2.
Looks like your circle is entirely out of the image (centered at -19, 3 with a radius of 10). But that should of course not cause any problems.
Fixed in 2-2 and HEAD: 2005-09-07 Michael Natterer <mitch@gimp.org> * app/core/gimpchannel-combine.c (gimp_channel_combine_ellipse): use gimp_rectangle_intersect() instead of just looking at the passed in w,h to figure whether nothing needs to be done. While the algorithm does nicely with an entirely out-of-image ellipse, the channel's bounds were set to a rectangle of zero width or height, which caused subsequent calls to gimp_channel_bounds() to return broken bounds. Fixes bug #315417. (gimp_channel_combine_rect) (gimp_channel_combine_mask): use gimp_rectangle_intersect() here too instead of the usual unclear CLAMPing on x1,y1,x2,y2.