- 1 Ağu 2007
- 5,470
- 41
İşinize yaramı bilmem ama çok sağlam çünkü kalite bozmadan resim croplamak için
Kod:
<?php
$imgfile = "img.jpg";
$cropStartX = 300;
$cropStartY = 250;
$cropW = 200;
$cropH = 200;
$origimg = imagecreatefromjpeg($imgfile);
$cropimg = imagecreatetruecolor($cropW,$cropH);
list($width, $height) = getimagesize($imgfile);
imagecopyresized($cropimg, $origimg, 0, 0, $cropStartX, $cropStartY, $width, $height, $width, $height);
header("Content-type: image/jpeg");
imagejpeg($cropimg);
imagedestroy($cropimg);
imagedestroy($origimg);
?>