Re: [PHP] [GD] Image errors

2009-07-15 Thread Peter Ford
Martin Scotta wrote: > Why are you ussing GD? > All you need is output the image to the browser? > > try this... I didn't test/run this code, but it may work... > > public function showPicture( $id ) { > header('Content-type:' . mime_content_type( $this->updir . $id . > '.png' ) ); >

Re: [PHP] [GD] Image errors

2009-07-15 Thread Peter Ford
Ash, Martin, Seems you are both wandering around the obvious problem... I suspect that $tipo (in the next line) is *supposed* to be $type - sounds like a partial Italian translation to me... So given that $type="imagecreatefrompng" (for example, if the mime check returns 'png' - not very reliabl

Re: [PHP] [GD] Image errors

2009-07-14 Thread Martin Scotta
Why are you ussing GD? All you need is output the image to the browser? try this... I didn't test/run this code, but it may work... public function showPicture( $id ) { header('Content-type:' . mime_content_type( $this->updir . $id . '.png' ) ); readfile( $this->updir . $id . '.png' )

Re: [PHP] [GD] Image errors

2009-07-14 Thread Ashley Sheridan
On Tue, 2009-07-14 at 14:16 -0300, Martin Scotta wrote: > On Tue, Jul 14, 2009 at 1:48 PM, Ashley > Sheridan wrote: > > On Tue, 2009-07-14 at 13:41 -0300, Martin Scotta wrote: > >> He is calling the function by variable > >> > >> something like this > >> > >> $func = 'var_dump'; > >> > >> $func( ne

Re: [PHP] [GD] Image errors

2009-07-14 Thread Martin Scotta
On Tue, Jul 14, 2009 at 1:48 PM, Ashley Sheridan wrote: > On Tue, 2009-07-14 at 13:41 -0300, Martin Scotta wrote: >> He is calling the function by variable >> >> something like this >> >> $func = 'var_dump'; >> >> $func( new Foo ); >> >> On Tue, Jul 14, 2009 at 1:30 PM, Ashley >> Sheridan wrote: >>

Re: [PHP] [GD] Image errors

2009-07-14 Thread Ashley Sheridan
On Tue, 2009-07-14 at 13:41 -0300, Martin Scotta wrote: > He is calling the function by variable > > something like this > > $func = 'var_dump'; > > $func( new Foo ); > > On Tue, Jul 14, 2009 at 1:30 PM, Ashley > Sheridan wrote: > > On Tue, 2009-07-14 at 13:27 -0300, Martin Scotta wrote: > >> $

Re: [PHP] [GD] Image errors

2009-07-14 Thread Martin Scotta
He is calling the function by variable something like this $func = 'var_dump'; $func( new Foo ); On Tue, Jul 14, 2009 at 1:30 PM, Ashley Sheridan wrote: > On Tue, 2009-07-14 at 13:27 -0300, Martin Scotta wrote: >> $immagine = $tipo($this->updir.$id.'.png'); >> >> $tipo is undefined >> >> >> On

Re: [PHP] [GD] Image errors

2009-07-14 Thread Ashley Sheridan
On Tue, 2009-07-14 at 13:27 -0300, Martin Scotta wrote: > $immagine = $tipo($this->updir.$id.'.png'); > > $tipo is undefined > > > On Tue, Jul 14, 2009 at 12:48 PM, Il pinguino > volante wrote: > > Hi to all > > > > I get a problem processing an image with GD libraries. > > > > This is my functi

Re: [PHP] [GD] Image errors

2009-07-14 Thread Martin Scotta
$immagine = $tipo($this->updir.$id.'.png'); $tipo is undefined On Tue, Jul 14, 2009 at 12:48 PM, Il pinguino volante wrote: > Hi to all > > I get a problem processing an image with GD libraries. > > This is my function > >   public function showPicture($id) { >       header('Content-type: image/

[PHP] [GD] Image errors

2009-07-14 Thread Il pinguino volante
Hi to all I get a problem processing an image with GD libraries. This is my function public function showPicture($id) { header('Content-type: image/jpeg'); $mime = mime_content_type($this->updir.$id.'.png'); $type = explode('/',$mime); $type = 'imagecreatefrom'.$t