Imagemagick

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Partythenwork
Posts: 2
Joined: 12 Apr 2011, 13:00

Imagemagick

Postby Partythenwork » 12 Apr 2011, 13:04

I was wondering if there is a way for sfs to launch some command line script after receiving data from a client?

I am assuming it would have to be a sfs extension doing the work, but i want to trigger imagemagick to edit a file after receiving certain commands from sfs.

Is there a way to do this?
Democre
Posts: 77
Joined: 16 Sep 2010, 17:58

Postby Democre » 12 Apr 2011, 15:40

There's always a way :wink:

I would think though that this is a dangerous approach. How many users could possibly use the system at the same time? How many could possibly issue the ImageMagick spawning commands at the same time? Can ImageMagick be made to be headless (no display, no keyboard and mouse input)? Can ImageMagick be run in multiple instances on the same machine at a time? How many instances can run before the processor or memory pegs (also with SFS running)?

Instead, depending on the manipulations you need, there are plenty of Java based imaging libraries, I would look at using one of them and doing the work in the system. Keep in mind though the above concerns about multiple simultaneous image manipulations. For instance registering and stitching images is fairly intense, and you could easily blow out memory if more than one such operation was happening at a time.

If you really want to launch an external application though, Google the usage of Runtime.exec();
Partythenwork
Posts: 2
Joined: 12 Apr 2011, 13:00

Postby Partythenwork » 12 Apr 2011, 17:16

Thanks for the heads up. I am familiar with using imagemagick to merge images, but maybe i should use an all java solution.

Do you know where i could see simple java examples of merging two images?

Thanks
Democre
Posts: 77
Joined: 16 Sep 2010, 17:58

Postby Democre » 12 Apr 2011, 17:28

I googled "java merge two pictures", and got some good hits. Without knowing the effect you're trying to do, I can't do any more than that for ya, sorry.

Good luck!
tchen
Posts: 191
Joined: 11 Dec 2010, 14:14

Postby tchen » 16 Apr 2011, 01:36

If you're already familiar with ImageMagick, then just look under the API section of it for some language bridges.

JMagick provides an object-oriented Java interface to ImageMagick. Im4java is a pure-java interface to the ImageMagick command-line.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 49 guests