Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 251
  • Last Modified:

Using C or C++ library for server side rendering of images

I want to build a web application. Here's more or less what it will do:

1. Allow a user to select some info from a web page
2. send this to the server
3. based on this the server renders an image via a C library
4. sends back to client

It can be  Windows only - so we can use IIS

There's a few ways to go with this. PHP with SWIG binding to the C lib. An ASP component. Ch CGI binding to the C lib via the Ch SDK and the list could go on.

I know c++ and PHP best although I can also work in VB and ASP and other stuff too.

I need some architectural suggestions that solve binding the web service (PHP, ASP or whatever)  to the C library in an efficient way, and in a way I can get up and running quickly without too much weird stuff.

Looking for the best, clearest suggest and way forward - an example VC project would be great

further questions welcome.

Thanks

0
_faraz
Asked:
_faraz
  • 4
  • 3
1 Solution
 
jkrCommented:
What kind of image based on what data do you want to create?
0
 
Infinity08Commented:
Do you know that you can generate images with PHP :

http://www.php.net/gd

? That's by far the simplest solution, especially since you already know PHP. And with this solution, you don't have to use C++.
0
 
_farazAuthor Commented:
The C library is my own and its generating a 3D image with OpenGL and several Gigabytes of data - the viewpoint is selected by the client and sent to the server.

Obviously the image has to be generated on the server rather than streaming the data down.

0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
_farazAuthor Commented:
So the key here is not the generation of the image, which has to be done in the C lib - the key is 1. how to interface this to a server-side web technology, 2. what are the benefits of the various options and 3. some suggestion of the most suitable solution ie if you think I should use an ASP component, please say why?

Thanks for your comments so far! Look forward to your suggestions
0
 
Infinity08Commented:
Why would you use an ASP component if you want to use PHP ? It's always a good idea to stick with the languages you know.

Have you thought about just using CGI ? Make a CGI script in C that calls your library (very straightforward), and then forward the requests to the CGI script.

If you want to use PHP, then the best way would be to write an extension to PHP, and call the library from that. Here is an introduction to writing PHP extensions if you want to use them :

        http://devzone.zend.com/public/view/tag/Extension

0
 
_farazAuthor Commented:
Thanks Infinity

I just want to use the best solution and one which will be easy to deploy. I know enough ASP to work with it, but I agree that sticking to the technology you know best is usually the best way.  I'll take a look at your suggestion of writing a PHP extension over the next few days.

Still welcome any further suggestions.

thanks
0
 
Infinity08Commented:
Note that the gd library I mentioned earlier (http://www.php.net/gd) is also an extension to PHP, and yours will most likely be very similar (except that it will call your library).
0
 
_farazAuthor Commented:
thanks for all your feedback, I've been side tracked onto something else at the moment but will respond next week.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now