Link to home
Start Free TrialLog in
Avatar of Vadivelmca
Vadivelmca

asked on

Create an Image on the fly ...

My Requirement is as follows:
*****************************

1. I would be showing design templates of business cards to the user as a gif.

2. The user after selecting a particular design, would type in the details he want inside the business card in the text boxes provided.

3. On submitting, the page should get refreshed and the image (design template selected by the user) should contain those text in it.

Please note you can either use ASP or PHP as a scriting language. You can also use VB for creating a COM if need be but my final output should be in a webbrowser.
(You can check www.iprint.com for further details. That site has used .cgi to achieve this desired result). I am desperatly in need of that code ASAP.

Thanks & Regards
Vadivel
ASKER CERTIFIED SOLUTION
Avatar of bruno
bruno
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PHP does not have built in support for that, you will need the gdlib to do that. After that it is fairly easy.

An object isn't necessary, but it does make life MUCH easier. ASP pages can write out images as long as the imagedata is written correctly (for example coming from a database).

CJ
EXPERTS:

This has been cross-posted in 3 TAs at 500 per posting, you might want to get an undertaking from the questioner on how they intend to resolve that, considering the amount of work involved.

Cd&
Avatar of Michel Sakr
here you will find some dlls and their sample codes..

http://www.aspin.com/func/search?tree=aspin&qry=create+gif+image&cat=

no need for custom components.. you may use custom components to access the database and to do some business logic..


regards
I see it as a homework..?
at EE we don't do full implementations of homeworks/tasks.. we mainly guid users to their destinations.. we may code some parts of the project.. fix errors.. so start by the guidelines we gave you..
(Urgent is a relative understanding)
Avatar of Vadivelmca
Vadivelmca

ASKER

brunobear:

I am going through the site you have specified. A basic doubt does ASPImage support adding or modifying of text into an image.

Silvers5:

I would go through the link you have specified and then discuss regarding that. In the mean time i thought i would clarify onething, I didn't expect a source code from anyone of you. I am just looking for some guidelines only.
Guidlines???  How about, read a book or two...

This is a huge project...  I estimate $4K to $5K.
I have a simple ocx as a base (well, more than base), but i don't like to post here but in VB TA.
mgfranz,
indeed did it once. Paid well ;-)
>>> This is a huge project...  I estimate $4K to $5K

If I understand the requirements correctly, this is not at all a big deal. A simple solution, requiring server side technology, can be found through ImageMagick:
http://www.imagemagick.org

check out a perl-driven web demo at:
http://www.imagemagick.org/MagickStudio/scripts/MagickStudio.cgi

-corey
coreyit,

"Please note you can either use ASP or PHP as a scriting language. You can also use VB for creating a
COM if need be but my final output should be in a webbrowser."

Last time I checked, Imagemagic was CGI...
With ASP and/or VB, you would use

LeadTools Raster Imaging
http://www.leadtools.com/Home2/vertmkts/RasterEngine.htm

or

PegasusTools ImageXPress
http://www.pegasustools.com/products/imagxpress.htm

These tools are neither free but inexpensive but are usually the developers' choice when it comes to image editing.

Notes:

+ VB: If you have some experience using VB you could do basic image editing yourself, but you would save as JPG, not as GIF.
Myself, I am both able to save an image as JPG, and adding text to an image, but it would take me a few days to merge both projects.
So if you're a beginner with that it's probably easier to buy the above linked components.

+ PHP: PHP (as well as other languages other than ASP/VBScript) do have image editing modules but you won't find many experts for this in the ASP topic area.

+ GIF: The GIF compression algorithm is patented by www.unisys.com.
Products like (the mentioned) LeadTools or PegasusTools use this original algorithm, and include the license for client-side image processing (like a desktop application)
(their licensing policy for server-side applications has not been clearly communicated. hence, to be on the right way, you would contact them per email about that -- anyways, those components will work).
Free PHP and Perl imaging modules (like mentioned by coreyit) "may" produce GIF files, but by using another than the patented compression algorithm (a suboptimal one). That's why the GIF files saved by them look blurry, and why the process of saving a GIF takes so much time.
(After all, try to not use GIF. It's proprietary, and expensive.)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As long as you have the GD library installed (which is free), you can create, load and manipulate JPEG, PNG, GIF, BMP images with w/o problems.

Short example:
http://devel.codefish.net/sample/sample.php4?text=This%20is%20an%20example%20of%20PHP%20and%20GDlib

Source code for the above example:
<?php
$img     =ImageCreateFromJPEG("../../images/water.jpg");
ImageString($img,5,100,100,"I'm dynamic: ".$HTTP_GET_VARS['text'],0xff0000);
ImageJPEG($img);
?>

That's all ;)
For ImageMagick with php, take a look at:
http://php.chregu.tv/imagick/

-corey
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Accept Answer by clockwatcher
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
GaryC123
EE Cleanup Volunteer
500 point Q, and certainly more than one good answer.  I believe my original comment should be worth something without feedback from the questioner.



I recommend a split please.
thanks!