Re: [PHP] imagejpeg() problem

2004-09-27 Thread Jonathan Haddad
Mike wrote:
the resizing part goes well; I don't really know what the imageinterlace 
function does, but I used it in desperation. Why: the output image's quality 
is visibly inferior to the source's. And I want the image to look good. The 
source is a jpeg (dinamic). As you probably have noticed, I set the quality 
parameter to 100, but uselessly.
What i'd like to know is whether php can output some quality jpegs, and if 
so, then how?
Thanks a lot! 
 

use imagecopyresampled instead of imagecopyresized for much better results.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] imagejpeg() problem

2004-09-27 Thread Mike
I tried that function too, but the same result...
"Jason Wong" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Tuesday 28 September 2004 02:16, Mike wrote:
>
>> What i'd like to know is whether php can output some quality jpegs, and 
>> if
>> so, then how?
>
> imagecopyresampled()
>
> -- 
> 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 98 is the most popular virus on the market today.
> */ 

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



Re: [PHP] imagejpeg() problem

2004-09-27 Thread Jason Wong
On Tuesday 28 September 2004 02:16, Mike wrote:

> What i'd like to know is whether php can output some quality jpegs, and if
> so, then how?

imagecopyresampled()

-- 
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 98 is the most popular virus on the market today.
*/

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



Re: [PHP] imageJPEG problem.

2001-09-25 Thread Stefan Rusterholz

Whooops, right. HTML after or before picture data doesn't make any sense :)
I checked my a bit older function, which puts out image data correctly
working.
I'm sorry, but I didn't see a big difference to yours...

But as I said before: I don't know what your doing at that lines where you
wrote:
$im = imagecreatefromjpeg("./test.jpg");
Imagejpeg($im,'',20);
ImageDestroy($im);

If I was you, I would try to open and read a valid jpeg file, just for
testing, if the output works. If it works, I'd search the error in that
lines written above.

Here a snippet from my routine (and now I see: header really has to be
image/jpeg, I must have been a little tired):
require("../protected/php_db_access.inc");
mysql_select_db('mydb');
$picture_types=array("jpg" => "image/jpeg", "gif" => "image/gif", "png" =>
"image/png");
$result=mysql_query("SELECT type,picture FROM $table[pictures] WHERE
id='$pic_id'");
$img_data=mysql_fetch_array($result);
$mime=$picture_types[$img_data['type']];
$img_bin=$img_data['image'];
header("Content-type: $mime");
echo $image;


I know that the routine could be written better, but I think I wrote it in a
hurry when I wrote it :)
Perhaps you can do something with that routine (it works fine on a linux
machine)...

regards
stefan rusterholz

- Original Message -----
From: "Hugh Danaher" <[EMAIL PROTECTED]>
To: "Stefan Rusterholz" <[EMAIL PROTECTED]>
Cc: "Php-General" <[EMAIL PROTECTED]>
Sent: Tuesday, September 25, 2001 9:33 AM
Subject: Re: [PHP] imageJPEG problem.


> Stephan,
> Check that there are no html statements or blank lines above the  I had a few blank lines in my first program, and it gave me the same error
> message.
> Hugh
>
>
> - Original Message -
> From: Stefan Rusterholz <[EMAIL PROTECTED]>
> To: Johan Vikerskog (EMP) <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Tuesday, September 25, 2001 12:13 AM
> Subject: Re: [PHP] imageJPEG problem.
>
>
> >
> > - Original Message -
> > From: "Johan Vikerskog (EMP)" <[EMAIL PROTECTED]>
> > To: "'Stefan Rusterholz'" <[EMAIL PROTECTED]>; "Johan Vikerskog
> (EMP)"
> > <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> > Sent: Tuesday, September 25, 2001 9:07 AM
> > Subject: RE: [PHP] imageJPEG problem.
> >
> >
> > > Thanks for your answer but the problem remains.
> > > It says i allready have given the header information and everything
> comes
> > out in ascii.
> > >
> > > file://Johan
> > >
> > > -Original Message-
> > > From: Stefan Rusterholz [mailto:[EMAIL PROTECTED]]
> > > Sent: den 25 september 2001 08:55
> > > To: Johan Vikerskog (EMP); [EMAIL PROTECTED]
> > > Subject: Re: [PHP] imageJPEG problem.
> > >
> > >
> > > - Original Message -
> > > From: "Johan Vikerskog (EMP)" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Tuesday, September 25, 2001 8:47 AM
> > > Subject: [PHP] imageJPEG problem.
> > >
> > >
> > > > When trying to use a simple code like this below i receive an error
> > which
> > > says that it cant find the header.
> > > >
> > > >  > > > Header("Content-type: image/jpeg");
> > >
> > > I don't know about the other stuff of your script, but when I wrote a
> > > similar script, I took "content-type: image/jpg" and not 'jpeg'.
> > > Probably that's the point...
> > >
> > > > $im = imagecreatefromjpeg("./test.jpg");
> > > > Imagejpeg($im,'',20);
> > > > ImageDestroy($im);
> > > > ?>
> > > >
> > > > It outputs the information in ascii and binary code. it doesn't show
> the
> > > picture
> > > >
> > > > Thanks for all the help you can give me.
> > > > file://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]
> >
> > make sure you run the php-part at the very top of the file:
> >  > header(...);
> > ?>
> > 
> > 
> > ...and so on
> >
> >
>

Re: [PHP] imageJPEG problem.

2001-09-25 Thread Hugh Danaher

Stephan,
Check that there are no html statements or blank lines above the 
To: Johan Vikerskog (EMP) <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Tuesday, September 25, 2001 12:13 AM
Subject: Re: [PHP] imageJPEG problem.


>
> - Original Message -
> From: "Johan Vikerskog (EMP)" <[EMAIL PROTECTED]>
> To: "'Stefan Rusterholz'" <[EMAIL PROTECTED]>; "Johan Vikerskog
(EMP)"
> <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Tuesday, September 25, 2001 9:07 AM
> Subject: RE: [PHP] imageJPEG problem.
>
>
> > Thanks for your answer but the problem remains.
> > It says i allready have given the header information and everything
comes
> out in ascii.
> >
> > file://Johan
> >
> > -Original Message-
> > From: Stefan Rusterholz [mailto:[EMAIL PROTECTED]]
> > Sent: den 25 september 2001 08:55
> > To: Johan Vikerskog (EMP); [EMAIL PROTECTED]
> > Subject: Re: [PHP] imageJPEG problem.
> >
> >
> > ----- Original Message -
> > From: "Johan Vikerskog (EMP)" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Tuesday, September 25, 2001 8:47 AM
> > Subject: [PHP] imageJPEG problem.
> >
> >
> > > When trying to use a simple code like this below i receive an error
> which
> > says that it cant find the header.
> > >
> > >  > > Header("Content-type: image/jpeg");
> >
> > I don't know about the other stuff of your script, but when I wrote a
> > similar script, I took "content-type: image/jpg" and not 'jpeg'.
> > Probably that's the point...
> >
> > > $im = imagecreatefromjpeg("./test.jpg");
> > > Imagejpeg($im,'',20);
> > > ImageDestroy($im);
> > > ?>
> > >
> > > It outputs the information in ascii and binary code. it doesn't show
the
> > picture
> > >
> > > Thanks for all the help you can give me.
> > > file://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]
>
> make sure you run the php-part at the very top of the file:
>  header(...);
> ?>
> 
> 
> ...and so on
>
>
> if you have output before you execute the php part, your webserver will
> generate the header for you and then it is impossible to send another
header
> (exactly because of what the warning tells you: the headers are already
> sent - but by the server and not by you and the server normally assumes
> text/html or text/plain).
>
>  I hope, it helps
>  regards
>
>  Stefan Rusterholz
>
>
>
>
>
> --
> 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] imageJPEG problem.

2001-09-24 Thread Stefan Rusterholz


- Original Message -
From: "Johan Vikerskog (EMP)" <[EMAIL PROTECTED]>
To: "'Stefan Rusterholz'" <[EMAIL PROTECTED]>; "Johan Vikerskog (EMP)"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Tuesday, September 25, 2001 9:07 AM
Subject: RE: [PHP] imageJPEG problem.


> Thanks for your answer but the problem remains.
> It says i allready have given the header information and everything comes
out in ascii.
>
> file://Johan
>
> -Original Message-
> From: Stefan Rusterholz [mailto:[EMAIL PROTECTED]]
> Sent: den 25 september 2001 08:55
> To: Johan Vikerskog (EMP); [EMAIL PROTECTED]
> Subject: Re: [PHP] imageJPEG problem.
>
>
> - Original Message -
> From: "Johan Vikerskog (EMP)" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, September 25, 2001 8:47 AM
> Subject: [PHP] imageJPEG problem.
>
>
> > When trying to use a simple code like this below i receive an error
which
> says that it cant find the header.
> >
> >  > Header("Content-type: image/jpeg");
>
> I don't know about the other stuff of your script, but when I wrote a
> similar script, I took "content-type: image/jpg" and not 'jpeg'.
> Probably that's the point...
>
> > $im = imagecreatefromjpeg("./test.jpg");
> > Imagejpeg($im,'',20);
> > ImageDestroy($im);
> > ?>
> >
> > It outputs the information in ascii and binary code. it doesn't show the
> picture
> >
> > Thanks for all the help you can give me.
> > file://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]

make sure you run the php-part at the very top of the file:



...and so on


if you have output before you execute the php part, your webserver will
generate the header for you and then it is impossible to send another header
(exactly because of what the warning tells you: the headers are already
sent - but by the server and not by you and the server normally assumes
text/html or text/plain).

 I hope, it helps
 regards

 Stefan Rusterholz





-- 
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] imageJPEG problem.

2001-09-24 Thread Johan Vikerskog (EMP)

When trying to use a simple code like this below i receive an error which says that it 
cant find the header.

 

It outputs the information in ascii and binary code. it doesn't show the picture

Thanks for all the help you can give me.
//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]