• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: [OT] call gifsicle via Java process
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OT] call gifsicle via Java process


  • Subject: Re: [OT] call gifsicle via Java process
  • From: "Jerry W. Walker" <email@hidden>
  • Date: Sat, 10 Feb 2007 09:43:57 -0500

HI, Ute,

This sounds very much like a permissions problem. It looks like gifsicle is throwing that first "Error with conversion" because it can't open a file which is cascading to the other errors.

You say that you are logged in as root. I presume you mean that when you "...open a terminal on the server and copy..." you are logged in as root. If that's the case, my first question is what user is your WO app running under?

When your WO app is running, do a ps command on Terminal to see what user it is running under. Then do an "su" command to that user on your terminal and try running the gifsicle command manually again as that user.

The other possibility (less likely) is that the user environment for your running WO app is missing some critical parameter for gifsicle. To test that, you might copy the following to a shell script:

#! /bin/sh
{
	echo "I am:"
	who am i
	echo "\nI am executing within the directory:"
	pwd
	echo "\nMy environment is:"
	env
} > /tmp/testoutput.txt

If you exec that little shell script from within your WOApp instead of gifsicle, it should answer all of the above questions. You will find the answers, of course, at /tmp/testout.txt.

Regards,
Jerry

On Feb 10, 2007, at 5:56 AM, Ute Hoffmann wrote:

Hallo,
I'm sorry for this off topic post, but im pulling my hair after hours of testing and looking and perhaps someone sees what I miss.


I need to call gifsicle from a java process to optimize .gif images (as imageMagick fails to do so and getting it working with ImageMagick seems to either need a very old IM version or some tuning of the tifflib. I looked into it but descided not to).

This is what I want to do:

call a exec from my java function which hands over the correct infos to gifsicle and gifsicle reading the file in and writing it optimized back to disk.

This is the error I get:
Fehler bei der KonversionTTGifsicle$Exception: Could not exec process: /usr/local/bin/gifsicle < /Library/WebServer/Documents/ cmsboard/ttwcmsdaten/bilder/tmp/26basispaket9.gif > /Library/ WebServer/Documents/cmsboard/ttwcmsdaten/bilder/tmp/ute_nn.gif: not found. invocation line: /usr/local/bin/gifsicle < /Library/ WebServer/Documents/cmsboard/ttwcmsdaten/bilder/tmp/ 26basispaket9.gif > /Library/WebServer/Documents/cmsboard/ ttwcmsdaten/bilder/tmp/ute_nn.gif. error output: null


The file is there. When I open a terminal on the server and copy
/usr/local/bin/gifsicle < /Library/WebServer/Documents/cmsboard/ ttwcmsdaten/bilder/tmp/26basispaket9.gif > /Library/WebServer/ Documents/cmsboard/ttwcmsdaten/bilder/tmp/ute_nn.gif


into the terminal gifsicle does as asked. Only difference aside from java involved/not involved: I'm logged in as root

So:
a) Do you think that what I see here is a permission problem
b) Has someone experience with calling gifsicle from java and could perhaps give me a code example of the call.


Thank you for some insight.

Regards

Ute

P.S:
This is my call:

String[] cmdArray = new String[] {
"/usr/local/bin/gifsicle "+"< "+sourceFilePath+" > "+outFilePath
};

NSMutableArray stdErrContents = new NSMutableArray();
NSMutableArray stdOutContents = new NSMutableArray();
int resultCode;
try {
resultCode = exec( cmdArray, stdOutContents, stdErrContents );
}
catch ....
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40gmail.com


This email sent to email@hidden


--
__ Jerry W. Walker,
WebObjects Developer/Instructor for High Performance Industrial Strength Internet Enabled Systems


    email@hidden
    203 278-4085        office



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >[OT] call gifsicle via Java process (From: Ute Hoffmann <email@hidden>)

  • Prev by Date: Re: Query on relationship to abstract entity failing w/horizontal inheritance
  • Next by Date: Data freshness and inter-applications/instances notification
  • Previous by thread: [OT] call gifsicle via Java process
  • Next by thread: Re: [OT] call gifsicle via Java process
  • Index(es):
    • Date
    • Thread