Re: [Gimp-developer] Another plugin question
First I want to thank you Sven for your so pleasant help. > there are several flaws in your plug-in (see below) but the main > problem is that you are trying to access data outside the > drawable. Yes, I needed time to understand it, but I finally understood. > - average() and variency both use a wrong index into the data > array thus accessing the wrong data. Your loops should go from > 0 to width/height, not from x to x + width, resp. y to y + height Ok for this. I couldn't know. > and using region->rowstride and region->bpp here does not make > sense. Why doesn't it make sense here? Are they undefined here or is this just because I'm only working on graylevels and only access data byte per byte? I corrected some other hints you gave me. Not added tile cache for the moment... I have another question : the plugin currently do not work for the reason that my writes in the output image are taken into account (or seem not to... ;-) Here are the incriminated lines : ---8<8<- /* Computes the variency and determine whether the pixel is part of a region or not. Colorify the output image */ if(variency(&window) > MAX_VARIENCY) { fprintf(stderr, "Setting 0 in pixel %d,%d\n", col, row); gimp_pixel_rgn_set_pixel(&outputRegion, &blackValue, col, row); } else { gimp_pixel_rgn_set_pixel(&outputRegion, &whiteValue, col, row); } ---8<8<- In my mind, my output image should be only black and white but I obtain many effects that are not really unlookable, but they are not the waited result =) ;-) I have uploaded the last version here (if anyone need to see the code again): http://tharibo.free.fr/GIMP/Textures.tar.gz -- [EMAIL PROTECTED] "Le temps ne fait rien à l'affaire, quand on est con, on-est-con !" -- Georges Brassens ___ Gimp-developer mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer
[Gimp-developer] Another plugin question
Hi all. Sorry to interrupt your (more important) conversation, but I still have problems with plugins. I really can't figure out why my plugin runs on and on and finally stopping some minutes later with a segmentation fault. I don't have infinite loop (I trust, but maybe there are hidden one, who knows =) but I think I'm doing something not the proper manner. Could someone just have a lookup on my code to see if he (her) finds anything with my use of libgimp? The code is here : http://tharibo.free.fr/GIMP/Textures.tar.gz There are a C file, a header file and their Makefile. Thanks in advance, -- [EMAIL PROTECTED] "Le temps ne fait rien à l'affaire, quand on est con, on-est-con !" -- Georges Brassens ___ Gimp-developer mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer
Re: [Gimp-developer] Plug-in development
> I am not sure if I understand your code correctly (I am even more of > a newby), but your code seems to only work on grayscale images. Did > you make sure your image was grayscale before you tested your plug-in > on it? Yes that's it: I had tested with a grayscaled image but it didn't work (a PNG image). I retried with a color image transformed into a grayscaled one and it works (enabled). Now I have to make it run without segfault =). Thanks to all. -- [EMAIL PROTECTED] "Le temps ne fait rien à l'affaire, quand on est con, on-est-con !" -- Georges Brassens ___ Gimp-developer mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer
[Gimp-developer] Plug-in development
Hi all. I'm a poor newbie trying to code a plugin for the Gimp, but I'm encountering some problems: I don't really understand all kind of things I did but finally succeeded to compile and install my plugin. The problem is that it is disabled in the menu. 1) I'm not sure this is the good place to ask this question, but it seemed to before I read the last 10 messages ;-) 2) If this is more easy for you to reply in seeing/compiling my code (commented out in french, sorry), you can find it here : http://tharibo.free.fr/GIMP/isodata.tar.gz Thanks in advance. -- [EMAIL PROTECTED] "Le temps ne fait rien à l'affaire, quand on est con, on-est-con !" -- Georges Brassens ___ Gimp-developer mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer