Re: [PHP] problem using imagejpeg function all

2006-11-22 Thread Richard Lynch
On Tue, November 21, 2006 10:31 pm, Tom wrote:
 I’m trying to use the imagejpeg function call in a php script and
 I
 can’t quite seem to get it working properly.

Can you clarify working properly into something a bit more concrete?

Right now, we're left guessing from the most likely scenario, that you
are seeing the:
yoya%#(*H*([EMAIL PROTECTED]
on your screen, because you've commented out the header line to tell
the browser to expect an image, all the way up through the aliens
attack and put me to sleep every time I reload :-)

 Would I need to have T1Lib support in order for this it work?

No.

Only if you wanted to use the T1 font/string functions within GD would
you need the T1Lib support.

 As a quick example, here is some code I’ve been playing around with
 that I
 found somewhere.

 ?php
  $image = imagecreate(200, 200);
  $colorRed = imagecolorallocate($image, 255, 0, 0);
  imagefill($image, 0, 0, $colorRed);

ImageFill might not do what you want with a new raw JPEG...

I mean, what color are all the pixels to start with?...

I would suggest that this is more suitable:
imagerectangle($image, 0, 0, 199, 199, $colorRed);

  //send image
  //header(Content-type: image/jpeg);

If you took this out for testing/debugging, that's great, but you have
to put it back in for the browser to know that it's a JPEG and not
HTML.

  imagejpeg($image);

 Should make a red square.

What did it actually make?

-- 
Some people have a gift link here.
Know what I want?
I want you to buy a CD from some starving artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

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



[PHP] problem using imagejpeg function all

2006-11-21 Thread Tom
Hello,

I’m trying to use the imagejpeg function call in a php script and I
can’t quite seem to get it working properly.

 

Here is my gd dump.

 

  'GD Version' = 'bundled (2.0.28 compatible)' (length=27)
  'FreeType Support' = true
  'FreeType Linkage' = 'with freetype' (length=13)
  'T1Lib Support' = false
  'GIF Read Support' = true
  'GIF Create Support' = true
  'JPG Support' = true
  'PNG Support' = true
  'WBMP Support' = true
  'XPM Support' = false
  'XBM Support' = true
  'JIS-mapped Japanese Font Support' = false

 

 

Would I need to have T1Lib support in order for this it work?

 

As a quick example, here is some code I’ve been playing around with that I
found somewhere.

 

?php
 $image = imagecreate(200, 200);
 $colorRed = imagecolorallocate($image, 255, 0, 0);
 imagefill($image, 0, 0, $colorRed);

 //send image
 //header(Content-type: image/jpeg);
 imagejpeg($image);

 

?

 

Should make a red square.

 

Any help would be greatly appreciated. Thank you.

 

Tom

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.14.11/543 - Release Date: 20/11/2006
9:20 PM
 


Re: [PHP] problem using imagejpeg function all

2006-11-21 Thread Robert Cummings
On Tue, 2006-11-21 at 23:31 -0500, Tom wrote:
 ?php
  $image = imagecreate(200, 200);
  $colorRed = imagecolorallocate($image, 255, 0, 0);
  imagefill($image, 0, 0, $colorRed);
 
  //send image
  //header(Content-type: image/jpeg);
  imagejpeg($image);
 
 ? 

Works for me with the header line uncommented.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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



RE: [PHP] problem using imagejpeg function all

2006-11-21 Thread Tom
Can you show me what your gd dump looks like?


?php
var_dump(gd_info());
 ?

Is that way I got mine.

Also, what php version are you using? I'm using 5.1.6.

Thanks for the info.

Tom


-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED] 
Sent: November 21, 2006 11:40 PM
To: Tom
Cc: php-general@lists.php.net
Subject: Re: [PHP] problem using imagejpeg function all

On Tue, 2006-11-21 at 23:31 -0500, Tom wrote:
 ?php
  $image = imagecreate(200, 200);
  $colorRed = imagecolorallocate($image, 255, 0, 0);
  imagefill($image, 0, 0, $colorRed);
 
  //send image
  //header(Content-type: image/jpeg);
  imagejpeg($image);
 
 ? 

Works for me with the header line uncommented.

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.14.11/543 - Release Date: 20/11/2006
9:20 PM
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.430 / Virus Database: 268.14.11/543 - Release Date: 20/11/2006
9:20 PM
 

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



RE: [PHP] problem using imagejpeg function all

2006-11-21 Thread Robert Cummings
On Tue, 2006-11-21 at 23:42 -0500, Tom wrote:
 Can you show me what your gd dump looks like?
 
 
 ?php
 var_dump(gd_info());
  ?
 
 Is that way I got mine.
 
 Also, what php version are you using? I'm using 5.1.6.

PHP 4.4.4 and PHP 5.2.0 both compiled from source.

This is my PHP 5.2.0 var_dump()...

array(11) {
  [GD Version]=
  string(27) bundled (2.0.28 compatible)
  [FreeType Support]=
  bool(false)
  [T1Lib Support]=
  bool(false)
  [GIF Read Support]=
  bool(true)
  [GIF Create Support]=
  bool(true)
  [JPG Support]=
  bool(true)
  [PNG Support]=
  bool(true)
  [WBMP Support]=
  bool(true)
  [XPM Support]=
  bool(false)
  [XBM Support]=
  bool(true)
  [JIS-mapped Japanese Font Support]=
  bool(false)
}

Cheers,
Rob.
-- 
..
| InterJinn Application Framework - http://www.interjinn.com |
::
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for   |
| creating re-usable components quickly and easily.  |
`'

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