Click here to get back home

determine text position in image

 HomeNewsGroups | Search | About
 comp.lang.php    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
determine text position in image sarika 07-18-2008
Get Chitika Premium
Posted by sarika on July 18, 2008, 2:57 am
Please log in for more thread options
Hi all
I want to create an online stamp making site. In my site a user select
a template from number of templates for making his stamp. The template
is and image with some graphics and text. Now user can change the text
in template but not the graphics .My requirement is how can i
determine the position of text in form of x,y coordinates using GD
libraries. As there will be number of templates which will be loaded
from admin panel and all templates will be having text at different
locations so i need some dynamic method to know the position of text
and graphic in image

Posted by arkascha on July 18, 2008, 3:08 am
Please log in for more thread options
sarika wrote:

> Hi all
> I want to create an online stamp making site. In my site a user select
> a template from number of templates for making his stamp. The template
> is and image with some graphics and text. Now user can change the text
> in template but not the graphics .My requirement is how can i
> determine the position of text in form of x,y coordinates using GD
> libraries. As there will be number of templates which will be loaded
> from admin panel and all templates will be having text at different
> locations so i need some dynamic method to know the position of text
> and graphic in image

It might help if you tell us the file format the graphics are stored in.
Without that, there is no way to tell.
But in general:
- in case you are using raster formats (gif, png, jpeg): forget it
- in case you are using post script (ps, eps): look into it
- in case you are using vector grafics: dunno, sorry, really

arkascha

Posted by C. (http://symcbean.blogspot.c on July 18, 2008, 7:57 am
Please log in for more thread options
> Hi all
> I want to create an online stamp making site. In my site a user select
> a template from number of templates for making his stamp. The template
> is and image with some graphics and text. Now user can change the text
> in template but not the graphics .My requirement is how can i
> determine the position of text in form of x,y coordinates using GD
> libraries. As there will be number of templates which will be loaded
> from admin panel and all templates will be having text at different
> locations so i need some dynamic method to know the position of text
> and graphic in image

Short answer is you can't.

Solution is to build a tool which allows you to through each image and
select the area of the image where the text should appear/be replaced.
Most of the hard waork for this would be in Javascript using floating
layers. Once captured then by all means use PHP to store the data
either externally or, using GD, in the metadata of the image file.

C.

Posted by Captain Paralytic on July 18, 2008, 8:03 am
Please log in for more thread options
> Hi all
> I want to create an online stamp making site. In my site a user select
> a template from number of templates for making his stamp. The template
> is and image with some graphics and text. Now user can change the text
> in template but not the graphics .My requirement is how can i
> determine the position of text in form of x,y coordinates using GD
> libraries. As there will be number of templates which will be loaded
> from admin panel and all templates will be having text at different
> locations so i need some dynamic method to know the position of text
> and graphic in image

Why not store the graphic with no text and in a table store the name
of the graphic plus the position whre you will want to put the text.
Then you can put the actual text there "on the fly" before sending the
complete image to the browser?

Posted by The Natural Philosopher on July 18, 2008, 11:13 am
Please log in for more thread options
Captain Paralytic wrote:
>> Hi all
>> I want to create an online stamp making site. In my site a user select
>> a template from number of templates for making his stamp. The template
>> is and image with some graphics and text. Now user can change the text
>> in template but not the graphics .My requirement is how can i
>> determine the position of text in form of x,y coordinates using GD
>> libraries. As there will be number of templates which will be loaded
>> from admin panel and all templates will be having text at different
>> locations so i need some dynamic method to know the position of text
>> and graphic in image
>
> Why not store the graphic with no text and in a table store the name
> of the graphic plus the position whre you will want to put the text.
> Then you can put the actual text there "on the fly" before sending the
> complete image to the browser?

Because the captcha images he is trying to crack don't work like that?

;-)

Similar ThreadsPosted
Output an image directly at a particular position in the browser window January 9, 2007, 6:16 am
determine if image is grayscale September 9, 2004, 6:24 pm
imagejpeg displays text of image name instead of image itself June 16, 2008, 4:45 pm
Background Text Image February 18, 2005, 11:47 am
Wrap text around image? December 26, 2005, 3:43 pm
convert image to text February 15, 2006, 9:43 am
GD center text on a image December 1, 2006, 3:34 pm
centering text in an image March 21, 2008, 5:14 pm
Image upload + posting text. How? September 3, 2006, 12:52 pm
Captcha image Text Size April 8, 2008, 1:17 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap