Re: JNI problem

2009-10-08 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mohamedin, On 10/8/2009 5:42 AM, Mohamedin wrote: > I have fixed this bug (Long time without coding in C). But still the > error. You didn't look for all uses of "sizeof": > while((bytes = read(inF, buff, sizeof(buff))) > 0) I think you meant this:

Re: JNI problem

2009-10-08 Thread Konstantin Kolinko
2009/10/8 Mohamedin : > Thanks a lot > > I have fixed this bug (Long time without coding in C). But still the error. > Then I removed all malloc from the code. Still crashing You are using free(..). Thus you need to have malloc()s somewhere. Also, (void) fprintf(stderr,"%s %s %d %.1024s\n",GetMag

Re: JNI problem

2009-10-08 Thread Mohamedin
ImgFile = (*env)->GetStringUTFChars(env, composeImg, &iscopy); const char *imageFile = (*env)->GetStringUTFChars(env, image, &iscopy); int ret = compose(composeImgFile, imageFile, position, width, height, shiftDirection, shiftAmount); (*env)->ReleaseStringUTFChars(env,

Re: JNI problem

2009-10-08 Thread Konstantin Kolinko
2009/10/8 Mohamedin : > Here is one function that always crash. The portion of the code that couse > the crash in my opinion is the if which has malloc. I noticed it crash > whenever it is called with the same srcFile and dstFile > > int reduce_quality(const char * srcFile, const char * dstFile, in

Re: JNI problem

2009-10-08 Thread Mohamedin
le); (*env)->ReleaseStringUTFChars(env, dst, dstFile); return ret; } Thanks, Mohamedin - Original Message - From: "Christopher Schultz" To: "Tomcat Users List" Sent: Wednesday, October 07, 2009 8:39 PM Subject: Re: JNI problem -BEGIN PGP SIGNED MES

Re: JNI problem

2009-10-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, On 10/7/2009 8:18 PM, Warnier wrote: > Christopher Schultz wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Mohamedin, >> >> On 10/7/2009 10:40 AM, Mohamedin wrote: >>> Dear all, >>> >>> I am trying to use a JNI library written

Re: JNI problem

2009-10-07 Thread André Warnier
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mohamedin, On 10/7/2009 10:40 AM, Mohamedin wrote: Dear all, I am trying to use a JNI library written by me that uses GraphicsMagick wand. It is working fine as a stand alone java application but when I tried to use it i

Re: JNI problem

2009-10-07 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Mohamedin, On 10/7/2009 10:40 AM, Mohamedin wrote: > Dear all, > > I am trying to use a JNI library written by me that uses > GraphicsMagick wand. It is working fine as a stand alone java > application but when I tried to use it in tomcat it give me