[PHP] Re: GD Library and outputing image

2007-06-15 Thread zerof

Ross escreveu:


$image = imagecreatefromjpeg($img_url);


$image in this case, is the Image Identifier, and returns something like 
, Resource id #NUMBER ( Resourse id allocation process, for the generic 
imagecreate... ).



if ($image === false) { die ('Unable to open image'); }

// Get original width and height
echo $width = imagesx($image);
echo $height = imagesy($image);

// New width and height
$new_width = 200;
$new_height = 150;

// Resample
$image_resized = imagecreatetruecolor($new_width, $new_height);


$image_resized is another Image Identifier


imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $new_width, 
$new_height, $width, $height);


The imagecopyressampled() returns a boolean value [ TRUE(1) or FALSE(0)].
This value can be used to test the function success.

A) If you haven't no problem with readers, you must use:

> // Display resized image
> header('Content-type: image/jpeg');
> imagejpeg($image_resized);
imagedestroy($image);
imagedestroy($image_resized);

So, in this case you have 2 Image Identifiers, to be destroyd at the 
end, to freely the processes.


imagedestroy($image);
imagedestroy($image_resized);

B) However, if you have problems with header, you must use:

imagejpeg ($image_resized,  "image.jpg");
echo '';
imagedestroy($image);
imagedestroy($image_resized);

instead of
>
> // Display resized image
> header('Content-type: image/jpeg');
> imagejpeg($image_resized);
imagedestroy($image);
imagedestroy($image_resized);


die();

This is not allowed here.
---
Please see an example of imagecopyressampled() here:

http://www.educar.pro.br/en/a/gdlib/index.php?pn=20&tr=97


--
zerof
http://www.educar.pro.br/
Apache - PHP - MySQL - Boolean Logics - Project Management
--
Você deve, sempre, consultar uma segunda opinião!
--
Deixe todos saberem se esta informação foi-lhe útil.
--  
You must hear, always, one second opinion! In all cases.
--
Let the people know if this info was useful for you!
--

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



[PHP] Re: GD library images not displaying

2005-06-21 Thread JB05UK

Found this in the PHP manual,


To enable GD-support configure PHP --with-gd[=DIR], where DIR is the GD 
base install directory. To use the recommended bundled version of the GD 
library (which was first bundled in PHP 4.3.0), use the configure option 
--with-gd. GD library requires libpng and libjpeg to compile.


In Windows, you'll include the GD2 DLL php_gd2.dll as an extension in 
php.ini. The GD1 DLL php_gd.dll was removed in PHP 4.3.2. Also note that 
the preferred truecolor image functions, such as imagecreatetruecolor(), 
require GD2.






So, why not try upgrade your PHP version.

James



Ross Trewhella wrote:


Hi,

I am running Apache 2.0 with PHP 4.2.11 on Windows XP.
I installed php_gd2.dll by uncommenting extension=php_gd2.dll and making sure 
that the file was in my extension_dir.
I restarted Apache and didn't get an error, so assumed it was working.
When I run my example code:

$im = imagecreatetruecolor (300, 200); 
$black = imagecolorallocate ($im, 0, 0, 0); 
$white = imagecolorallocate ($im, 255, 255, 255); 
imagefilledrectangle($im,0,0,399,99,$white); 
imagerectangle($im,20,20,250,190,$black); 
header ("Content-type: image/png"); 
imagepng ($im);

?>

I get the following error:

Fatal error: Call to undefined function: imagecreatetruecolor() in 
imagetest.php on line 2

This code works on other servers, so where have I gone wrong in my installation 
of GD?

Thanks in advance,

Ross
 



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



[PHP] Re: Gd Library and Special Chars

2004-06-11 Thread news.php.net
Ok, i have solved problem with copyright and registered by using  
imagettftext...

But i still can't print correctly tm symbol :(
On Fri, 11 Jun 2004 11:56:14 +0200, News.Php.Net <[EMAIL PROTECTED]> wrote:
Hi to all,
I need to do parsing of html data from one site for find nick , guild,  
and some other infos...

The problem is that gd doesn't print correctly chars like trademark,  
copyright, registered (which are contained in some nicks/guild names)...

Someone know a valid solution???

--
Using Opera's revolutionary e-mail client: http://www.opera.com/m2/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] RE: GD Library Upgrade

2004-06-01 Thread Jason Wong
On Wednesday 02 June 2004 07:47, Ryan Schefke wrote:

> I have root access to my server.  It's a dedicated server with 1and1.com.

OK.

> I have zero experience with shell commands and will be working off of any
> directions I can find online.

There're plenty of those to be found. The list archives should have plenty of 
posts from myself (and others!) regarding the recompiling/reconfiguring of 
PHP and the installation of GD lib.

> I'm researching whether to upgrade PHP from 4.2.2 to 4.3.6 or just upgrade
> the GD Library from 1.8.4 to the latest.  But I'm still not sure if it's
> best to upgrade the entire thing or just the library.

Well one way to base your decision on salient facts is to find out what has 
changed between the 4.2.2 & 4.3.6 (and the intervening versions) by reading 
the changelogs. Then decide whether the bug fixes and improvements are worth 
your while to upgrade to.

> I'm totally new at installing apps via shell...if anyone is interested in
> doing it for a small fee please let me know!

If you're using a pre-installed dedicated server then it's more than likely it 
has a version of RedHat on it. You may be lucky and be able to upgrade PHP 
via RPM. But AFAIK RedHat has never (or hardly ever) provided PHP upgrades.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Windows 99 has been released! (PC Magazine, April 2013)
*/

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



RE: [PHP] RE: GD Library Upgrade

2004-06-01 Thread Ryan Schefke
Jason,

I have root access to my server.  It's a dedicated server with 1and1.com.  I
have zero experience with shell commands and will be working off of any
directions I can find online.  

I'm researching whether to upgrade PHP from 4.2.2 to 4.3.6 or just upgrade
the GD Library from 1.8.4 to the latest.  But I'm still not sure if it's
best to upgrade the entire thing or just the library.

I'm totally new at installing apps via shell...if anyone is interested in
doing it for a small fee please let me know!

Ryan

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 01, 2004 2:25 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] RE: GD Library Upgrade

On Wednesday 02 June 2004 01:10, Ryan Schefke wrote:

> So there's no way to upgrade PHP 4.2.2's GD Library without upgrading to
> the latest version of PHP?

That was not what was said nor implied in my reply. Basically upgrading the
GD 
lib used by PHP needs root privileges. If I understand you correctly, you're

on a shared host, thus _you_ are not able to upgrade anything.

If you do manage to persuade your hosting company to do an upgrade then they

may as well upgrade PHP and use the bundled GD lib which apparently works 
better with PHP than the standard GD lib as opposed to just upgrading the GD

lib.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Put your Nose to the Grindstone!
-- Amalgamated Plastic Surgeons and Toolmakers, Ltd.
*/

-- 
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] RE: GD Library Upgrade

2004-06-01 Thread Jason Wong
On Wednesday 02 June 2004 01:10, Ryan Schefke wrote:

> So there's no way to upgrade PHP 4.2.2's GD Library without upgrading to
> the latest version of PHP?

That was not what was said nor implied in my reply. Basically upgrading the GD 
lib used by PHP needs root privileges. If I understand you correctly, you're 
on a shared host, thus _you_ are not able to upgrade anything.

If you do manage to persuade your hosting company to do an upgrade then they 
may as well upgrade PHP and use the bundled GD lib which apparently works 
better with PHP than the standard GD lib as opposed to just upgrading the GD 
lib.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Put your Nose to the Grindstone!
-- Amalgamated Plastic Surgeons and Toolmakers, Ltd.
*/

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



RE: [PHP] RE: GD Library Upgrade

2004-06-01 Thread Ryan Schefke
So there's no way to upgrade PHP 4.2.2's GD Library without upgrading to the
latest version of PHP?

Ryan

-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 01, 2004 5:21 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] RE: GD Library Upgrade

On Tuesday 01 June 2004 12:42, Ryan Schefke wrote:

> I'm working with a host on a Linux box with PHP 4.2.2.  The version of GD
> Library they have is 1.8.4.  I was uploading some pictures using a script
> that leveraged GD Library 2+.  Using the php version with the newer GD
> library seemed to produce a better quality image.  I have two questions:
>
>
>
> 1 - Can a newer version of GD Library (1.8.4 vs 2+) make a difference in
> image quality?

Possibly. You would have to read the changelog of GD to see.

> 2 - I'd like to upgrade the Linux box that has PHP 4.2.2 and GD Library
> 1.8.4 to the most recent version.  Is this easy?  Any guidance?  Do I need
> a patch?

You would normally have to recompile PHP to get it use a newer version of
GD. 
If your host allowed you to do so then you might as well upgrade your
version 
of PHP and use the bundled GD libs.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Q:  Why did the programmer call his mother long distance?
A:  Because that was her name.
*/

-- 
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] RE: GD Library Upgrade

2004-06-01 Thread Jason Wong
On Tuesday 01 June 2004 12:42, Ryan Schefke wrote:

> I'm working with a host on a Linux box with PHP 4.2.2.  The version of GD
> Library they have is 1.8.4.  I was uploading some pictures using a script
> that leveraged GD Library 2+.  Using the php version with the newer GD
> library seemed to produce a better quality image.  I have two questions:
>
>
>
> 1 - Can a newer version of GD Library (1.8.4 vs 2+) make a difference in
> image quality?

Possibly. You would have to read the changelog of GD to see.

> 2 - I'd like to upgrade the Linux box that has PHP 4.2.2 and GD Library
> 1.8.4 to the most recent version.  Is this easy?  Any guidance?  Do I need
> a patch?

You would normally have to recompile PHP to get it use a newer version of GD. 
If your host allowed you to do so then you might as well upgrade your version 
of PHP and use the bundled GD libs.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Q:  Why did the programmer call his mother long distance?
A:  Because that was her name.
*/

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



[PHP] RE: GD Library Upgrade

2004-05-31 Thread Ryan Schefke
Any thoughts on this?

 

I'm working with a host on a Linux box with PHP 4.2.2.  The version of GD
Library they have is 1.8.4.  I was uploading some pictures using a script
that leveraged GD Library 2+.  Using the php version with the newer GD
library seemed to produce a better quality image.  I have two questions:

 

1 - Can a newer version of GD Library (1.8.4 vs 2+) make a difference in
image quality?

2 - I'd like to upgrade the Linux box that has PHP 4.2.2 and GD Library
1.8.4 to the most recent version.  Is this easy?  Any guidance?  Do I need a
patch?

 

PS - I've been working off of this site: http://www.boutell.com/gd but
wanted to bounce this around with some experts first.

 



[PHP] Re: GD library update

2003-06-21 Thread Yury B .
Thank you the problem is solved, I just downloaded php_gd2.dll from 
gd site and inabled it in php.ini Now everything is working as it 
should.

Yury

On 19 Jun 2003 at 17:24, Andrei BEJENARU wrote:

> 
> "Yury B ." <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > Hi,
> > I need to use function imagecreatetruecolor() in my script but it
> > doesn't work on my local apache+php+mysql on XP server. It works fine
> > on the real server though but i need to play with it around. What do
> > I need to do to get it work? from docs I understand I need gd 2.0.1
> > or higher, well how to get it and how to install?
> >
> > Thank you,
> >
> > Yury
> 
> The gd library is shipped with the PHP distribution, so you should simply
> upgrade to version 4.3.1 or 4.3.2.
> You must download the big zip distribution, as it has all the needed
> libraries.
> Follow the instructions in the install readme file and you should have no
> problems.
> 
> Andrei BEJENARU
> 
> 
> 

<>< <>< <>< <>< God is our provider ><> ><> ><> ><> 
http://www.body-builders.org/


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



[PHP] Re: GD library update

2003-06-19 Thread Andrei BEJENARU

"Yury B ." <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Hi,
> I need to use function imagecreatetruecolor() in my script but it
> doesn't work on my local apache+php+mysql on XP server. It works fine
> on the real server though but i need to play with it around. What do
> I need to do to get it work? from docs I understand I need gd 2.0.1
> or higher, well how to get it and how to install?
>
> Thank you,
>
> Yury

The gd library is shipped with the PHP distribution, so you should simply
upgrade to version 4.3.1 or 4.3.2.
You must download the big zip distribution, as it has all the needed
libraries.
Follow the instructions in the install readme file and you should have no
problems.

Andrei BEJENARU



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



[PHP] Re: GD Library

2002-07-25 Thread Mitja Stepan

Instead of :
;extension=php_gd.dll

Try:
extension=php_gd.dll

Sign ; is a comment... so you must delete it ...

--
Lp,
Mitja
"Ryan Moore" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am trying to use GD Library on a windows 2000 installation of PHP.
> php_gd.dll is in the extensions folder and the line:
";extension=php_gd.dll"
> is in my php.ini file, but I recieve the error: "Fatal error:  Call to
> undefined function:  imagecreate()" when I try to use the
> imagecreate(100,100) function. Any ideas?
>
> Thanks!
>
>



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




[PHP] Re: GD library

2002-04-11 Thread Ron Allen

This is for a Windows 2000 server

"Ron Allen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have downloaded the GD library and I am wondering how do I install it..
>
> I unzipped it and put it my root.  I have PHP version 4.1.1...what
else
> is there to do?  Does anybody have any script for me to test it real
quick?
>
>



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




[PHP] Re: gd-library ...

2002-03-10 Thread Andy

Hi Marcel,

I did struggle with the same prop a while ago.

It's quit easy. Get yourself php4.1.2 . This version has the gd library
included. after installing uncomment
the libgd module line in php.ini. Look out for the different versions. There
might be one line for the old 1.8x library.
save it and restart your webserver.

Thats it.

Good luck, Andy

"Marcel Besancon" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
> i'm trying to use the gd-library under windows, but it doesn't work.
How
> can I include the gd.dll? Where do I put this file? I tried some different
> directories which are written in the php.ini as include-directories. What
am
> I doing wrong? Is there a way to use this library under windows???
>
> Any hint can be useful.
>
> Sincerely
>
> Marcel
>
> --
> registered Fli4l-User #0388
>
>



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




[PHP] Re: gd library

2002-01-31 Thread David Robley

In article <[EMAIL PROTECTED]>, 
[EMAIL PROTECTED] says...
> Hi =)
> 
> Which version of the gd library comes with PHP?
> 
> Thanks,
> -Ed
> 
> 
For *nix, it doesn't - you have to go get it yourself. For Windows, - 
I'll leave that for someone else.

-- 
David Robley
Temporary Kiwi!

-- 
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] Re: gd-library

2001-09-08 Thread Richard Lynch


You either see GD in all that mess, or it ain't there.

--
WARNING [EMAIL PROTECTED] address is an endangered species -- Use
[EMAIL PROTECTED]
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
- Original Message -
From: Gert Mellak <[EMAIL PROTECTED]>
Newsgroups: php.general
To: <[EMAIL PROTECTED]>
Sent: Friday, September 07, 2001 7:29 AM
Subject: gd-library


> hi!
>
> How can I find out if gd-library is installed on my server and if not, how
> can I install it
>
> please email me if you want to help me.
>
> TIA,
>
> gert.
> email: [EMAIL PROTECTED]
> http://www.mellak.com
>
>
>


-- 
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]