basically i have a large image 500x 500, i wana resize it to a smaller size, but the quality will stays, means image will not be pixelated or distorted. i am using php, below are my code, but i am having problems with it, would appreciated if some1 code help me out and give me some advices. $nw = 100; $nh = 100; $source = "http://img58.imageshack.us/img58/9644/400pxcodeblueip7.jpg"; $stype = "jpg"; $dest =""; $size = getimagesize($source); $w = $size[0]; $h = $size[1]; switch($stype) { case 'gif': $simg = imagecreatefromgif($source); break; case 'jpg': $simg = imagecreatefromjpeg($source); break; case 'png': $simg = imagecreatefrompng($source); break; } $dimg = imagecreatetruecolor($nw, $nh); $wm = $w/$nw; $hm = $h/$nh; $h_height = $nh/2; $w_height = $nw/2; if($w> $h) { $adjusted_width = $w / $hm; $half_width = $adjusted_width / 2; $int_width = $half_width - $w_height; imagecopyresampled($dimg,$simg,-$int_width,0,0,0,$adjusted_width,$nh,$w,$h); } elseif(($w <$h) || ($w == $h)) { $adjusted_height = $h / $wm; $half_height = $adjusted_height / 2; $int_height = $half_height - $h_height; imagecopyresampled($dimg,$simg,0,-$int_height,0,0,$nw,$adjusted_height,$w,$h); } else { imagecopyresampled($dimg,$simg,0,0,0,0,$nw,$nh,$w,$h); } imagejpeg($dimg,$dest,100); PHP: i dont know why, when i preview it, it give me all kinds of weird coding.. like the below. ÿØÿà JFIFÿþ¿ËëŸ^õÂ9#hÃUÑÃ,Šê]a•â€â€šY~òÂWGùý?ü—á‘gð7Ç_ÛWá¤ØýËø_öÄøñ®[Zۄo¥üMñÄ‘s•†m6h°â€(6Å’[¿ØÂö‡ÒAOÿÃM¿l &%É‚ÛǾý–¾([#à …ÜjŸ³þ¯\D>PÑË®‰J‚ ûœ¹ü9¨µñY5«â€Z¶×º\ÿG¶Ú£õcÿh/ØÅ~ñö¡ûN~Þ2³øûA; Ãx&xÜ|øñ¿Ìú?Âü-úÂÂܪýžÃÆ:]¼Z•›´iq$¶ŠÑWkû1ÃE¼ñ;Åð¢h ê?³WÃM¢2Xë_ |z~æx’ò?—ûKáÇŠ¦Xôoiš‰G¸ÓmÃnΡ=¶^Þ´Šicêô_€·žÂ-´:·ÃïáiVz†•vd¸ý¼#¦x‡P´´»©éz–«§|TÂFkmJÇ6âçLð¾—{krVæ;‚ŠÃ?ûlÛ~ÎÚ'ÃûÂOöÊñ/ìÇ©éâÊãKðÃÃÄ?k'‹$ºŸ÷±ÙøFç@ñGˆ¼|·ò]$RÅÿU„ºâ€S"Ãm›åµ q“ömº¶I§N2ºÕY>d›K{Y.òk[žÖìú/^‡é¬n$Pà ðyµ½9Ç9â£ò86x<ÿ\ñÃõ Žy¯æ Ã?·GÃiðNÃö{ð‡ÃÂ~/ñ·ÃoøƒÇÞøauâgM‹ì¾O¨xjöûVÖþ \ø{ƺW‡|<ÃáýV{â-Ž…§Yé— ºþ¤ÈÚ2þ°]x³öÃø‡ðòêýü7ÿ úÛÅ>šëK¾ø9iðïÆ~4ÃãÕ´ã-ÂþŸªüHø£áÿ¾³`'ŽaøGS±k˜Ê— Code (markup):
headers_sent($filename, $linenum); echo 'Headers sent at: ' , $filename , ' ' , $linenum; PHP: Remember, you must set headers before ANY output at all. Where's it sending output on yours? Move the header line above that one.
Hi Folks This is Shaik Actually I have applied the image croppied functionality. Its working fine in local system, but when I apply the same things in server its not working. Can any one help me to resolve my issue. Thanks
@mussarath - try not to duplicate your post or dig up really old threads, I've responded to your new one in the same forum.