Re: [PHP] problem with ImageCreateJPEG ...

2001-12-04 Thread Miguel Loureiro

Hello ,
sorry for taking your time, but I still dont understand why I got errors with
pjeg...
I use the following code on other machine with jpeg support to , and it works,
while in my machine I got an empty jpeg file
?
 Header(Content-type: image/jpeg);
 $im=ImageCreate(400,200);
 $bcg  = ImageColorAllocate($im,240,240,240);
 $prt  = ImageColorAllocate($im,0,0,0);
 $rd   = ImageColorAllocate($im,255,0,0);
 ImageFill($im,400,200,$bcg);
 ImageLine($im,110,85,280,85,$rd);
 ImageString($im,5,130,90,--- OK ---,$prt);
 ImageLine($im,110,110,280,110,$rd);
 ImageJPEG($im,a.jpg);
?
html
body
img src=a.jpg
/body
/html

Is it possible that, even when see result of phpinfo(); and see that I have
jpeg support , jpeg library isnt well compiled or gd??
if I use PNG instead I got no problems

Jim wrote:

 It is difficult to know where your problem is without more information.

 It would appear that your jpeg file is not valid. Try another .jpg file.

 Post the problem code, too.

 Hello all,
 anyone can help me 
 
 in line command to configure php :
 './configure' '--with-mysql'
 
 '--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/'
 
 '--with-zlib-dir=/usr/src/packages/SOURCES/zlib/'
 
 '--with-png-dir=/usr/src/packages/SOURCES/libpng/'
 
 '--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/'
 
 '--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars'
 
 in result of phpinfo() :
  gd
 
   GD Support
   enabled
 
   GD Version
   1.6.2
 or higher
   JPG Support
   enabled
 
   PNG Support
   enabled
 
   WBMP Support
   enabled
 
 
 
  zlib
 
   ZLib Support
 
 enabled
   'zlib:' fopen wrapper
 
 enabled
   Compiled Version
 
 1.1.3
   Linked Version
 
 1.1.3
 
 
 ,but when use ImageCreateFromJPEG:
 br
 bWarning/b:  imagecreatefromjpeg: .../testout.jpg' is not a valid
 JPEG file in b../a.php/b on line b4/bbr
 br
 bWarning/b:  Supplied argument is not a valid Image resource in
 b../a.php/b on line b14 = ImageJPEG()
 
 what is my problem
 
 --
 Best Regards
 Miguel Joaquim Rodrigues Loureiro
 
 
 
 --
 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]

 --
 Jim Musil
 -
 Multimedia Programmer
 Nettmedia
 -
 212-629-0004
 [EMAIL PROTECTED]

--
Best Regards
Miguel Joaquim Rodrigues Loureiro




-- 
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] problem with ImageCreateJPEG ...

2001-12-04 Thread Johan Holst Nielsen



sorry for taking your time, but I still dont understand why I got errors with
pjeg...
I use the following code on other machine with jpeg support to , and it works,
while in my machine I got an empty jpeg file
?
 Header(Content-type: image/jpeg);
 $im=ImageCreate(400,200);
 $bcg  = ImageColorAllocate($im,240,240,240);
 $prt  = ImageColorAllocate($im,0,0,0);
 $rd   = ImageColorAllocate($im,255,0,0);
 ImageFill($im,400,200,$bcg);
 ImageLine($im,110,85,280,85,$rd);
 ImageString($im,5,130,90,--- OK ---,$prt);
 ImageLine($im,110,110,280,110,$rd);
 ImageJPEG($im,a.jpg);
?
html
body
img src=a.jpg
/body
/html

Try to remove all html, and instead make a ImageJPEG($img);

You should then only get the JPEG file?

You set a header, and the browser doesn't understand the HTML...

regards
Johan


-- 
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] problem with ImageCreateJPEG ...

2001-12-04 Thread Jack Dempsey

also, are you sure both versions of php were compiled the same way with the
same options and support?

-Original Message-
From: Johan Holst Nielsen [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 04, 2001 9:22 AM
To: Miguel Loureiro; [EMAIL PROTECTED]
Subject: Re: [PHP] problem with ImageCreateJPEG ...




sorry for taking your time, but I still dont understand why I got errors
with
pjeg...
I use the following code on other machine with jpeg support to , and it
works,
while in my machine I got an empty jpeg file
?
 Header(Content-type: image/jpeg);
 $im=ImageCreate(400,200);
 $bcg  = ImageColorAllocate($im,240,240,240);
 $prt  = ImageColorAllocate($im,0,0,0);
 $rd   = ImageColorAllocate($im,255,0,0);
 ImageFill($im,400,200,$bcg);
 ImageLine($im,110,85,280,85,$rd);
 ImageString($im,5,130,90,--- OK ---,$prt);
 ImageLine($im,110,110,280,110,$rd);
 ImageJPEG($im,a.jpg);
?
html
body
img src=a.jpg
/body
/html

Try to remove all html, and instead make a ImageJPEG($img);

You should then only get the JPEG file?

You set a header, and the browser doesn't understand the HTML...

regards
Johan


--
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] problem with ImageCreateJPEG ...

2001-12-03 Thread Jim


It is difficult to know where your problem is without more information.

It would appear that your jpeg file is not valid. Try another .jpg file.

Post the problem code, too.






Hello all,
anyone can help me 

in line command to configure php :
'./configure' '--with-mysql'

'--with-apache=/usr/src/packages/SOURCES/apache_1.3.9/'

'--with-zlib-dir=/usr/src/packages/SOURCES/zlib/'

'--with-png-dir=/usr/src/packages/SOURCES/libpng/'

'--with-jpeg-dir=/usr/src/packages/SOURCES/jpeg-6b/'

'--with-gd=/usr/src/packages/SOURCES/gd' '--enable-track-vars'

in result of phpinfo() :
 gd

  GD Support
  enabled

  GD Version
  1.6.2
or higher
  JPG Support
  enabled

  PNG Support
  enabled

  WBMP Support
  enabled



 zlib

  ZLib Support

enabled
  'zlib:' fopen wrapper

enabled
  Compiled Version

1.1.3
  Linked Version

1.1.3


,but when use ImageCreateFromJPEG:
br
bWarning/b:  imagecreatefromjpeg: .../testout.jpg' is not a valid
JPEG file in b../a.php/b on line b4/bbr
br
bWarning/b:  Supplied argument is not a valid Image resource in
b../a.php/b on line b14 = ImageJPEG()

what is my problem

--
Best Regards
Miguel Joaquim Rodrigues Loureiro



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


-- 
Jim Musil
-
Multimedia Programmer
Nettmedia
-
212-629-0004
[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]