• Downloading from our site will require you to have a paid membership. Upgrade to a Premium Membership from 10$ a month today!

    Dont forget read our Rules! Also anyone caught Sharing this content will be banned. By using this site you are agreeing to our rules so read them. Saying I did not know is simply not an excuse! You have been warned.

Admin giúp em về đóng dấu ảnh

JavaFC

New Member
Anh có code hay phần mềm gì đóng dấu ảnh cho em xin, code thì upload lên đóng hàng loạt
 
Xem thêm kái này...
hinh-anh-khong-gian-vu-tru-dep-07-1280x800.jpg
Đầu tiên bạn chuẩn bị 1 LOGO (định dạng PNG) và 1 tấm ảnh cần chèn.
ví dụ là
- QuocHan.jpg
- logo.png
tải lên 1 thư mục trên host. và tạo 1 file là images.php vớ nội dung như sau
PHP:
<?php
        $imagesource = 'QuocHan.jpg'; // địa chỉ ảnh cần chèn
	if (!file_exists($imagesource)) die ();
	$filetype = strtolower(substr($imagesource,strlen($imagesource)-4,4));
	if($filetype == ".gif") $image = @ imagecreatefromgif($imagesource);
	if($filetype == ".jpg") $image = @ imagecreatefromjpeg($imagesource);
	if($filetype == ".png") $image = @imagecreatefrompng($imagesource);
	if (empty($image)) die();
	$watermark = @imagecreatefrompng('logo.png'); // đây là logo
	$imagewidth = imagesx($image);
	$imageheight = imagesy($image);
	$watermarkwidth = imagesx($watermark);
	$watermarkheight = imagesy($watermark);
	$startwidth = (($imagewidth - $watermarkwidth)/25);
	$startheight = (($imageheight - $atermarkheight)/20);
	imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight);
	header("Content-type: image/jpeg");
	imagejpeg($image);
	imagedestroy($image);
	imagedestroy($watermark);
?>
xong bạn cứ chạy file images.php là thấy thành quả ngay
demo:
chưa add:
13227943551150006349_574_574.jpg

đã add
9.jpg

Chúc bạn thành công!
 

Facebook Comments

Similar threads

New posts New threads New resources

Back
Top