Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 12-01-2005, 02:41 PM   #21
In Runtime
 
jamieoliver22's Avatar
 
Join Date: Apr 2004
Posts: 245
Default Re: Coding Images to change

How exactly do you install the GD libary? What directory do they go?

(And where is php.ini?)

Thanks
J
__________________

jamieoliver22 is offline   Reply With Quote
Old 12-02-2005, 04:33 AM   #22
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: Coding Images to change

Do you have access to the server? (i.e is this a home server or are you buying hosting?)...

to check if the GD library is installed create a simple script like this

Code:
<?php
phpinfo();
?>
That page will tell you all the modules that are installed.
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 12-02-2005, 05:09 AM   #23
In Runtime
 
jamieoliver22's Avatar
 
Join Date: Apr 2004
Posts: 245
Default Re: Coding Images to change

Hiya.

It is a paid deciated server (even tho i get it for free as i know the right people :P)
I have access to the server (through a cPanel). I can easily contact my host to ask them to add anything.

The file is here:
http://yextreme.matrixnetworks.net/testground/info.php

Thanks
Jamie
jamieoliver22 is offline   Reply With Quote
Old 12-02-2005, 08:59 AM   #24
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: Coding Images to change

The problem is that you don't have the GD module installed...


they'll have to add the library (either.so or .dll depending on whether it's Linux/unix or windows).
and they'll have to alter the PHP.ini file to tell it to load the module as well...

I don't thin that this can be done with cpanel access so you'll have to get your hosting provider to do this for you.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 12-02-2005, 11:40 AM   #25
In Runtime
 
jamieoliver22's Avatar
 
Join Date: Apr 2004
Posts: 245
Default Re: Coding Images to change

I have send a support ticket to them.
Hopefully I should get a reply in a few hours.

J
jamieoliver22 is offline   Reply With Quote
Old 12-08-2005, 12:11 PM   #26
In Runtime
 
jamieoliver22's Avatar
 
Join Date: Apr 2004
Posts: 245
Default Re: Coding Images to change

Okay, I managed to get the GD Libary installed!

I got the IP one too work! Now, how do you edit the size and content and such?
How to you make it overlap an exsisting PNG image?

Thanks
Jamie
jamieoliver22 is offline   Reply With Quote
Old 12-09-2005, 05:48 AM   #27
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: Coding Images to change

header ("Content-type: image/png");

headers are sent to make sure the broswer knows it's a picture, and not text.

$im = @ImageCreateFromPNG ("php.png");
if(!$im) {

all that line does is check that an image can be created, if you can create an image space then nothing else happens.

$len = 8*(strlen($ip))+6;
$hig = 16;

those lines check the length of the IP address, so a different sized address will generate different numbers, (eg 4.0.0.1 or 217.195.167.105) so a larger box is drawn for a longer text string...

$img_handle = ImageCreate ($len, $hig) or die ("Cannot Create image");
that line actually creates the image where $len is the horizontal length of the image and $hig is the height, so you can change these to be however you want them to to create large or small images.

$back_color = ImageColorAllocate ($img_handle, 0, 0, 0);
The first colour set is the back colour for the image

$txt_color = ImageColorAllocate ($img_handle, 255, 255, 255);

and that sets the forecolour, note that you cab define and use any number of colours that you want.

ImageString ($img_handle, 3, 5, 1, "$ip", $txt_color);
Image string function draws text on a picture


ImagePng ($img_handle); }
and that actually forms the picture from al the information that been stored in the memory space $inmg_handle

?>


You coluld draw on an image by getting rid of the second rceateimage line and just using the first image pointer ($im) which I'd only used as a test...

to be honest you'll find far more help on the PHP site than I can feasibly give you here, just use the function search to look up some of the functions, and you could look at the related functions as well.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 12-09-2005, 03:38 PM   #28
In Runtime
 
jamieoliver22's Avatar
 
Join Date: Apr 2004
Posts: 245
Default Re: Coding Images to change

Okay thank you!

I have a PNG image (made in CS2) and I just want to add text over it in differnt places.
Is this easy to do?

J
jamieoliver22 is offline   Reply With Quote
Old 12-10-2005, 07:27 AM   #29
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,004
Default Re: Coding Images to change

yes... so long as you know where you want to put the text...

ImageString ($img_handle, 3, 5, 1, "$ip", $txt_color);

draws an picture of the words, the arguments are text size (1-5). xposition, (from left) yposition (from top), the actualy string, and the colour (defined with imagecolorallocate() function.

to position text on a picture, just find where you want to put it, and then enter the co-ordinates of where you'd like it.
__________________

__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 01:42 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0