Re: PAGE TURNED BECOME SOURCE CODE VIEW..

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, July 14, 2006 3:34 am, BBC wrote:
>> On 7/9/06, BBC <bbc_danang@xxxxxxxxxx> wrote:

> $tumbsize = 150;
> $imgfile = $some_where;
> $imgdst = $where_to;
> header('Content-type: image/jpeg');
> list($width,$height) = getimagesize($imgfile);
> $imgratio = $width/$height;
> if($imgratio>1)
> {
>  $newwidth = $tumbsize;
>  $newheight = (int)($tumbsize / $imgratio);
> }else{
>  $newheight = $tumbsize;
>  $newwidth = (int)($tumbsize * $imgratio);
> }
> $tumb = ImageCreateTrueColor($newwidth,$newheight);
> $source = ImageCreateFromJpeg($imgfile);
> $hai =
> ImageCopyResized($tumb,$source,0,0,0,0,$newwidth,$newheight,$width,$height);
> ImageJpeg($tumb,$imgdst,100);
> if ($hai)
> {
>     echo "Resizing is successful<br> ";

This right here is going to mess things up...

You've told the browser that you are sending a JPEG.

The text above is not part of a valid JPEG.

Use error_log() and check your Apache/whatever error logs when
generating non HTML output.

> }else{
> copy($some_where,$where_to);
> }
>
> And thank for your input..
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux