Create a free blog, web site, photo album, guestbook, earn money, share things with your friends!
Login | Sign Up 
Mehmet KAYA'nınsitesine hoş geldiniz!
çalışmalarımı burada görebilirsiniz!

resim düzenleme programı


// alt iki satırda dosyayı belirliyor be onu % kaç resize edicemiyi yazıoz.
$filename = "dene.jpg";
$percent = 0.5;

header("Content-type: image/jpeg");

// ve seçilen yüzdelik(percent) ile yeni boyutlarımızı oluşturuyoz.
list($width, $height) = getimagesize($filename);
$newwidth = 180;
$newheight = 160;

// artık kaynağı yeni boyutları ile harmanladık.
$thumb = imagecreatetruecolor($newwidth, $newheight);
$source = imagecreatefromjpeg($filename);

// resim bu bölümde son halini yani yeni boyutlarını aldı
imagecopyresampled($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);

// ve dosyayı istenen % olarak kalite ile istenen adrese kaydettik
imagejpeg($thumb, "dene.jpg", 100);
?>

emrah ülker
emrah@planesoft.net
Programlama > PHP


Resim crop lama

İşinize yaramı bilmem ama çok sağlam çünkü kalite bozmadan resim croplamak için


Hepsini Seç

$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);

?>





Date: 10 April 2007, Tuesday
Comments (0) | Add Comment



Comments (0)

Add a new comment:
Name:
E-Mail:
Your website (if you have):
Your Message:
Security Code:


Archive

2007 (29)
 June (1)
 May (4)
 April (9)
 March (4)
 January (11)
2006 (10)
 December (10)

My Photos

Inube Slide Show



Search