Re: [PHP] Image Manipulation/GD support

2002-03-24 Thread Richard Archer

At 8:17 PM -0800 23/3/02, Rasmus Lerdorf wrote:

>failing.  I use gd2 these days because the 8-bit limitation of gd1 just
>sucks.  You can find my simple gd2 instructions here
>http://www.php.net/~rasmus/gd.html

I found that enabling GD and freetype support in php-4.1.2 was not
this simple. php-4.1.2 seems to require gd-2.0.2 which has not yet
been released.

Here's a description of how I got it working:
http://mel01.juggernaut.com.au/patches/gd/

 ...Richard.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Image Manipulation/GD support

2002-03-23 Thread Rasmus Lerdorf

> reading the ./configure -h I see that they CHANGED what the configure
> options mean.
> now --with-freetype=dir refers to freetype 2

Untrue, it only refers to freetype2 when you are building against GD2.

> phpinfo() says I have FreeType linkage.
> But both ImageFtText and ImageTTFText fail to do anything.
>
> What is up with that?
>
> Perl is losing popularity because every time it updates scripts frequently
> need some rewriting (that and cpan will grab the latest module and then
> try to grab a newer perl instead of grabbing the module that works with
> the installed perl- g)
> Hopefully php isn't going that route.
>
> Is this just a bug or has there been a major change?
> I'm going to have to find myself trying php 4.0.6 and possibly reverting
> back to 4.0.5 if I can't get this resolved.

Works just fine for me.  Play with your config.log and see what is
failing.  I use gd2 these days because the 8-bit limitation of gd1 just
sucks.  You can find my simple gd2 instructions here
http://www.php.net/~rasmus/gd.html

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Image Manipulation/GD support

2002-03-23 Thread Michael A. Peters

On the topic of gd support but a slightly different topic-

I was using php 4.0.5

gd 1.8.3 patched for gif support (using libungif for libgif which I
*think* is OK)
FreeType 1.3.1 (compiled myself in /usr/local )
t1lib 1.3.1 (compiled myself in /usr/local )

I was using gd to draw pictures and write text on them with ttf fonts.
I saw there were some new image functions in >= 4.0.6 so I grabbed the
latest php

I use a script to compile php
same compile options, but t1lib gave a ptoblem because instead of looking
in /usr/local/lib it tried to find the library in /usr/lib/.libs

the configure option id --with-t1lib=/usr/local

cd /usr/lib
ln -s /usr/local/lib .libs

took care of that but I really don't want to do that.
Anyway, my big problem is with freetype.

compiled
I could draw and open images, but could not write ttf fonts on them.

reading the ./configure -h I see that they CHANGED what the configure
options mean.
now --with-freetype=dir refers to freetype 2

Personally I think its insane to change the meaning of a configure option,
but OK.
So I downloaded FreeType 2 and compiled it and installed in /usr/local

recompiled php

Still can't use ttf to write on images.

phpinfo() says I have FreeType linkage.
But both ImageFtText and ImageTTFText fail to do anything.

What is up with that?

Perl is losing popularity because every time it updates scripts frequently
need some rewriting (that and cpan will grab the latest module and then
try to grab a newer perl instead of grabbing the module that works with
the installed perl- g)
Hopefully php isn't going that route.

Is this just a bug or has there been a major change?
I'm going to have to find myself trying php 4.0.6 and possibly reverting
back to 4.0.5 if I can't get this resolved.

My compile options are here- http://macaddict4life.dhs.org/info.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




RE: [PHP] Image Manipulation/GD support

2002-03-23 Thread Navid Yar

Rasmus, thanks so much! It's executing. I've run into another problem
with this script, but I'll try to figure this one out as best I can
first before posting it. Thanks again!  :)

-Original Message-
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, March 23, 2002 4:41 PM
To: Navid Yar
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Image Manipulation/GD support

Try image/jpeg as your content-type

On Sat, 23 Mar 2002, Navid Yar wrote:

> Hello,
>
> I just enabled GD support for PHP via the php.ini file. When I try to
> run a script that uses the functions included in the library, it gives
> me a dialog box asking me whether I want to save the php file to a
> specific location or not. I don't need to save it, I need PHP to run
it.
> This is happening on two machines enabled with the gd library. I'm
using
> PHP 4.0.6, while my remote host machine is using 4.1.1. Do I need a
more
> current version of the GD library to run this script? Here is the
> script:
>
> 
> $image = "images/pic.jpg";
>
> if (!$max_width)
>$max_width = 150;
> if (!max_height)
>$max_height= 150;
>
> $size = GetImageSize($image);
> $width = $size[0];
> $height = $size[1];
>
> $x_ratio = $max_width / $width;
> $y_ratio = $max_height / $height;
>
> if (($width <= $max_width) && ($height <= $max_height)) {
>$tn_width = $width;
>$tn_height = $height;
> }
> elseif (($x_ratio * $height) < $max_height) {
>$tn_height = ceil($x_ratio * $height);
>$tn_width = $max_width;
> }
> else {
>$tn_width = ceil($y_ratio * $width);
>$tn_height = $max_height;
> }
>
> $src = ImageCreateFromJpeg ($image);
> $dst = ImageCreate ($tn_width, $tn_height);
> ImageCopyResized ($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height,
$width,
> $height);
> header ("Content-type: image/jpg");
> ImageJpeg ($dst, null, -1);
> ImageDestroy ($src);
> ImageDestroy ($dst);
>
> ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Image Manipulation/GD support

2002-03-23 Thread Rasmus Lerdorf

Try image/jpeg as your content-type

On Sat, 23 Mar 2002, Navid Yar wrote:

> Hello,
>
> I just enabled GD support for PHP via the php.ini file. When I try to
> run a script that uses the functions included in the library, it gives
> me a dialog box asking me whether I want to save the php file to a
> specific location or not. I don't need to save it, I need PHP to run it.
> This is happening on two machines enabled with the gd library. I'm using
> PHP 4.0.6, while my remote host machine is using 4.1.1. Do I need a more
> current version of the GD library to run this script? Here is the
> script:
>
> 
> $image = "images/pic.jpg";
>
> if (!$max_width)
>$max_width = 150;
> if (!max_height)
>$max_height= 150;
>
> $size = GetImageSize($image);
> $width = $size[0];
> $height = $size[1];
>
> $x_ratio = $max_width / $width;
> $y_ratio = $max_height / $height;
>
> if (($width <= $max_width) && ($height <= $max_height)) {
>$tn_width = $width;
>$tn_height = $height;
> }
> elseif (($x_ratio * $height) < $max_height) {
>$tn_height = ceil($x_ratio * $height);
>$tn_width = $max_width;
> }
> else {
>$tn_width = ceil($y_ratio * $width);
>$tn_height = $max_height;
> }
>
> $src = ImageCreateFromJpeg ($image);
> $dst = ImageCreate ($tn_width, $tn_height);
> ImageCopyResized ($dst, $src, 0, 0, 0, 0, $tn_width, $tn_height, $width,
> $height);
> header ("Content-type: image/jpg");
> ImageJpeg ($dst, null, -1);
> ImageDestroy ($src);
> ImageDestroy ($dst);
>
> ?>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php