Re: [PHP] Importing a GIF image and making it transparent

2001-08-21 Thread Ben Quinn

G'day Chris

Yep i did, with this code

$id = ImageCreateFromGif("http://mirror.bom.gov.au/radar/IDR503.gif";);

I get this error :<

Warning: imagecreatefromgif: Sockets are not supported for image type 'GIF'
in /home/httpd/html/bsch/temp/monkey.php on line 5

Brick wall #9080982093848934  - but i guess that makes the end result just
that little bit better :-)

BTW - can anyone recommend a good GD install tutorial? If i can't run this
script on my website i'll install PHP and GD and run it from my computer



- Original Message -
From: "Chris Lambert" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 21, 2001 8:45 PM
Subject: Re: [PHP] Importing a GIF image and making it transparent


> Did you use quotes around the URL when trying to access the image?
>
> /* Chris Lambert, CTO - [EMAIL PROTECTED]
> WhiteCrown Networks - More Than White Hats
> Web Application Security - www.whitecrown.net
> */
>
> - Original Message -
> From: Ben Quinn <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, August 21, 2001 6:09 AM
> Subject: Re: [PHP] Importing a GIF image and making it transparent
>
>
> |
> | Thanks to those who replied, i finally worked it out - the script has
been
> | pasted below just incase anyone is sifting through the list archives
> looking
> | for the same thing.  One thing though, my server doesn't allow me to
open
> a
> | GIF file through HTTP - ie this doesn't work
> |
> | $image = ImageCreateFromGif(http://www.severname.com/image.gif);
> |
> | Does anyone know of a server/hosting company that will allow me to do
> this?
> |
> |
> | The script:
> |
> |  |
> | $id = ImageCreateFromGif("image.gif");
> |
> | $trans = imagecolorexact($id, 120, 100, 90);
> |
> | imagecolortransparent($id, $trans);
> |
> | ImageGIF($id,"newimage.gif");
> |
> | echo "done";
> |
> | ?>
> |
> |
> |
> | ----- Original Message -
> | From: "Chris Lambert" <[EMAIL PROTECTED]>
> | To: "Ben Quinn" <[EMAIL PROTECTED]>
> | Cc: <[EMAIL PROTECTED]>
> | Sent: Tuesday, August 21, 2001 4:49 PM
> | Subject: Re: [PHP] Importing a GIF image and making it transparent
> |
> |
> | > It doesn't look like you'll be able to use GD, as GIF support was
> dropped
> | in
> | > 1.6 and JPEG support was only added in 1.8. You'd have to experiment
> with
> | > ImageMagick, or another command-line tool independent of PHP.
> | >
> | > /* Chris Lambert, CTO - [EMAIL PROTECTED]
> | > WhiteCrown Networks - More Than White Hats
> | > Web Application Security - www.whitecrown.net
> | > */
> | >
> | > - Original Message -
> | > From: Ben Quinn <[EMAIL PROTECTED]>
> | > To: <[EMAIL PROTECTED]>
> | > Sent: Tuesday, August 21, 2001 2:23 AM
> | > Subject: [PHP] Importing a GIF image and making it transparent
> | >
> | >
> | > | Hi all
> | > |
> | > |  I've been trying to make a script that imports a GIF image from an
> | > external
> | > | server (i have permission to do this, see below) and designates a
> | certain
> | > | colour transparent for some time now and i'm not having much luck.
Can
> | > | anyone help or provide a script that does this?
> | > |
> | > | The images i'm using are Australian weather radar images with a
rather
> | > plain
> | > | brown background
> | > |
> | > | http://mirror.bom.gov.au/radar/IDR503.gif
> | > |
> | > | What i'd like to do is have an orographic map for the background,
like
> | > this
> | > |
> | > | http://www.bsch.au.com/temp/preview.jpg
> | > |
> | > | The radar images are available to the public and i have permission
to
> | make
> | > | these alterations
> | > |
> | > | Is it possible for PHP to download a GIF image (through HTTP),
> designate
> | a
> | > | certain colour transparent and then display the image on the screen
> | > without
> | > | saving the image to the server?
> | > |
> | > | Any help i can get with this would be much appreciated
> | > |
> | > |
> | > |
> | > |
> | > | --
> | > | PHP General Mailing List (http://www.php.net/)
> | > | To unsubscribe, e-mail: [EMAIL PROTECTED]
> | > | For additional commands, e-mail: [EMAIL PROTECTED]
> | > | To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> | > |
> | > |
> | > |
> | >
> | >
> | > --
> | > PHP General Mailing List (http://www.php.net/)
> | > To un

Re: [PHP] Importing a GIF image and making it transparent

2001-08-21 Thread Chris Lambert

Did you use quotes around the URL when trying to access the image?

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Ben Quinn <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 21, 2001 6:09 AM
Subject: Re: [PHP] Importing a GIF image and making it transparent


|
| Thanks to those who replied, i finally worked it out - the script has been
| pasted below just incase anyone is sifting through the list archives
looking
| for the same thing.  One thing though, my server doesn't allow me to open
a
| GIF file through HTTP - ie this doesn't work
|
| $image = ImageCreateFromGif(http://www.severname.com/image.gif);
|
| Does anyone know of a server/hosting company that will allow me to do
this?
|
|
| The script:
|
| 
|
|
|
| - Original Message -
| From: "Chris Lambert" <[EMAIL PROTECTED]>
| To: "Ben Quinn" <[EMAIL PROTECTED]>
| Cc: <[EMAIL PROTECTED]>
| Sent: Tuesday, August 21, 2001 4:49 PM
| Subject: Re: [PHP] Importing a GIF image and making it transparent
|
|
| > It doesn't look like you'll be able to use GD, as GIF support was
dropped
| in
| > 1.6 and JPEG support was only added in 1.8. You'd have to experiment
with
| > ImageMagick, or another command-line tool independent of PHP.
| >
| > /* Chris Lambert, CTO - [EMAIL PROTECTED]
| > WhiteCrown Networks - More Than White Hats
| > Web Application Security - www.whitecrown.net
| > */
| >
| > - Original Message -
| > From: Ben Quinn <[EMAIL PROTECTED]>
| > To: <[EMAIL PROTECTED]>
| > Sent: Tuesday, August 21, 2001 2:23 AM
| > Subject: [PHP] Importing a GIF image and making it transparent
| >
| >
| > | Hi all
| > |
| > |  I've been trying to make a script that imports a GIF image from an
| > external
| > | server (i have permission to do this, see below) and designates a
| certain
| > | colour transparent for some time now and i'm not having much luck. Can
| > | anyone help or provide a script that does this?
| > |
| > | The images i'm using are Australian weather radar images with a rather
| > plain
| > | brown background
| > |
| > | http://mirror.bom.gov.au/radar/IDR503.gif
| > |
| > | What i'd like to do is have an orographic map for the background, like
| > this
| > |
| > | http://www.bsch.au.com/temp/preview.jpg
| > |
| > | The radar images are available to the public and i have permission to
| make
| > | these alterations
| > |
| > | Is it possible for PHP to download a GIF image (through HTTP),
designate
| a
| > | certain colour transparent and then display the image on the screen
| > without
| > | saving the image to the server?
| > |
| > | Any help i can get with this would be much appreciated
| > |
| > |
| > |
| > |
| > | --
| > | PHP General Mailing List (http://www.php.net/)
| > | To unsubscribe, e-mail: [EMAIL PROTECTED]
| > | For additional commands, e-mail: [EMAIL PROTECTED]
| > | To contact the list administrators, e-mail:
[EMAIL PROTECTED]
| > |
| > |
| > |
| >
| >
| > --
| > PHP General Mailing List (http://www.php.net/)
| > To unsubscribe, e-mail: [EMAIL PROTECTED]
| > For additional commands, e-mail: [EMAIL PROTECTED]
| > To contact the list administrators, e-mail: [EMAIL PROTECTED]
| >
| >
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Importing a GIF image and making it transparent

2001-08-21 Thread Ben Quinn


Thanks to those who replied, i finally worked it out - the script has been
pasted below just incase anyone is sifting through the list archives looking
for the same thing.  One thing though, my server doesn't allow me to open a
GIF file through HTTP - ie this doesn't work

$image = ImageCreateFromGif(http://www.severname.com/image.gif);

Does anyone know of a server/hosting company that will allow me to do this?


The script:





- Original Message -
From: "Chris Lambert" <[EMAIL PROTECTED]>
To: "Ben Quinn" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 21, 2001 4:49 PM
Subject: Re: [PHP] Importing a GIF image and making it transparent


> It doesn't look like you'll be able to use GD, as GIF support was dropped
in
> 1.6 and JPEG support was only added in 1.8. You'd have to experiment with
> ImageMagick, or another command-line tool independent of PHP.
>
> /* Chris Lambert, CTO - [EMAIL PROTECTED]
> WhiteCrown Networks - More Than White Hats
> Web Application Security - www.whitecrown.net
> */
>
> - Original Message -
> From: Ben Quinn <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, August 21, 2001 2:23 AM
> Subject: [PHP] Importing a GIF image and making it transparent
>
>
> | Hi all
> |
> |  I've been trying to make a script that imports a GIF image from an
> external
> | server (i have permission to do this, see below) and designates a
certain
> | colour transparent for some time now and i'm not having much luck. Can
> | anyone help or provide a script that does this?
> |
> | The images i'm using are Australian weather radar images with a rather
> plain
> | brown background
> |
> | http://mirror.bom.gov.au/radar/IDR503.gif
> |
> | What i'd like to do is have an orographic map for the background, like
> this
> |
> | http://www.bsch.au.com/temp/preview.jpg
> |
> | The radar images are available to the public and i have permission to
make
> | these alterations
> |
> | Is it possible for PHP to download a GIF image (through HTTP), designate
a
> | certain colour transparent and then display the image on the screen
> without
> | saving the image to the server?
> |
> | Any help i can get with this would be much appreciated
> |
> |
> |
> |
> | --
> | PHP General Mailing List (http://www.php.net/)
> | To unsubscribe, e-mail: [EMAIL PROTECTED]
> | For additional commands, e-mail: [EMAIL PROTECTED]
> | To contact the list administrators, e-mail: [EMAIL PROTECTED]
> |
> |
> |
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Importing a GIF image and making it transparent

2001-08-21 Thread David Robley

On Tue, 21 Aug 2001 16:24, Ben Quinn wrote:
> Hi Chris,
>
> Thanks for the speedy reply.  In the GD section here
> http://www.bsch.au.com/admin/phpinfo.php
> it says "GIF support - enabled"
>
> I'm starting to wonder though if PHP can do this? I looked up the
> imagecolourtransparent function on the PHP site and it says:
>
> int imagecolortransparent (int im [, int col])
>
> ImageColorTransparent() sets the transparent color in the im image to
> col. Im is the image identifier returned by ImageCreate() and col is a
> color identifier returned by ImageColorAllocate().
>
> Note "Im is the image identifier returned by ImageCreate()" - does this
> mean this function only works with images PHP has created?

I wonder if it might not work on the image identifier returned from 
ImageCreateFromGIF, which is presumably what you are using?

-- 
David Robley  Techno-JoaT, Web Maintainer, Mail List Admin, etc
CENTRE FOR INJURY STUDIES  Flinders University, SOUTH AUSTRALIA  

   A diplomat thinks twice before saying nothing.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Importing a GIF image and making it transparent

2001-08-20 Thread Ben Quinn

Hi Chris,

Thanks for the speedy reply.  In the GD section here
http://www.bsch.au.com/admin/phpinfo.php
it says "GIF support - enabled"

I'm starting to wonder though if PHP can do this? I looked up the
imagecolourtransparent function on the PHP site and it says:

int imagecolortransparent (int im [, int col])

ImageColorTransparent() sets the transparent color in the im image to col.
Im is the image identifier returned by ImageCreate() and col is a color
identifier returned by ImageColorAllocate().

Note "Im is the image identifier returned by ImageCreate()" - does this mean
this function only works with images PHP has created?



- Original Message -
From: "Chris Lambert" <[EMAIL PROTECTED]>
To: "Ben Quinn" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Tuesday, August 21, 2001 4:49 PM
Subject: Re: [PHP] Importing a GIF image and making it transparent


> It doesn't look like you'll be able to use GD, as GIF support was dropped
in
> 1.6 and JPEG support was only added in 1.8. You'd have to experiment with
> ImageMagick, or another command-line tool independent of PHP.
>
> /* Chris Lambert, CTO - [EMAIL PROTECTED]
> WhiteCrown Networks - More Than White Hats
> Web Application Security - www.whitecrown.net
> */
>
> - Original Message -
> From: Ben Quinn <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, August 21, 2001 2:23 AM
> Subject: [PHP] Importing a GIF image and making it transparent
>
>
> | Hi all
> |
> |  I've been trying to make a script that imports a GIF image from an
> external
> | server (i have permission to do this, see below) and designates a
certain
> | colour transparent for some time now and i'm not having much luck. Can
> | anyone help or provide a script that does this?
> |
> | The images i'm using are Australian weather radar images with a rather
> plain
> | brown background
> |
> | http://mirror.bom.gov.au/radar/IDR503.gif
> |
> | What i'd like to do is have an orographic map for the background, like
> this
> |
> | http://www.bsch.au.com/temp/preview.jpg
> |
> | The radar images are available to the public and i have permission to
make
> | these alterations
> |
> | Is it possible for PHP to download a GIF image (through HTTP), designate
a
> | certain colour transparent and then display the image on the screen
> without
> | saving the image to the server?
> |
> | Any help i can get with this would be much appreciated
> |
> |
> |
> |
> | --
> | PHP General Mailing List (http://www.php.net/)
> | To unsubscribe, e-mail: [EMAIL PROTECTED]
> | For additional commands, e-mail: [EMAIL PROTECTED]
> | To contact the list administrators, e-mail: [EMAIL PROTECTED]
> |
> |
> |
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] Importing a GIF image and making it transparent

2001-08-20 Thread Chris Lambert

It doesn't look like you'll be able to use GD, as GIF support was dropped in
1.6 and JPEG support was only added in 1.8. You'd have to experiment with
ImageMagick, or another command-line tool independent of PHP.

/* Chris Lambert, CTO - [EMAIL PROTECTED]
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/

- Original Message -
From: Ben Quinn <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 21, 2001 2:23 AM
Subject: [PHP] Importing a GIF image and making it transparent


| Hi all
|
|  I've been trying to make a script that imports a GIF image from an
external
| server (i have permission to do this, see below) and designates a certain
| colour transparent for some time now and i'm not having much luck. Can
| anyone help or provide a script that does this?
|
| The images i'm using are Australian weather radar images with a rather
plain
| brown background
|
| http://mirror.bom.gov.au/radar/IDR503.gif
|
| What i'd like to do is have an orographic map for the background, like
this
|
| http://www.bsch.au.com/temp/preview.jpg
|
| The radar images are available to the public and i have permission to make
| these alterations
|
| Is it possible for PHP to download a GIF image (through HTTP), designate a
| certain colour transparent and then display the image on the screen
without
| saving the image to the server?
|
| Any help i can get with this would be much appreciated
|
|
|
|
| --
| PHP General Mailing List (http://www.php.net/)
| To unsubscribe, e-mail: [EMAIL PROTECTED]
| For additional commands, e-mail: [EMAIL PROTECTED]
| To contact the list administrators, e-mail: [EMAIL PROTECTED]
|
|
|


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]