View Single Post
ישן 24-04-09, 01:13   # 1
FuZuL
חבר מתקדם
 
מיני פרופיל
תאריך הצטרפות: Oct 2006
הודעות: 354

FuZuL לא מחובר  

פרסום | קיבוע לוגו על תמונה

בעקבות מערכת שאני בונה חיפשתי סקריפט ברשת ולא מצאתי אחד שמאחד בין jpeg לpng,
לכן למען הדורות הבאים אני מפרסם אותו.

הסקריפט מקבע לוגו על קובץ, נבנה עבור מערכת העלאת קבצים.

PHP קוד:
<?php
$logo_file 
"logo.png";
$image_file "img.jpg";
$targetfile "img2.jpg";
$photo imagecreatefromjpeg($image_file);
$fotoW imagesx($photo);
$fotoH imagesy($photo);
$logoImage imagecreatefrompng($logo_file);
$logoW imagesx($logoImage);
$logoH imagesy($logoImage);
$photoFrame imagecreatetruecolor($fotoW,$fotoH);
$dest_x $fotoW $logoW;
$dest_y $fotoH $logoH;
imagecopyresampled($photoFrame$photo0000$fotoW$fotoH$fotoW$fotoH);
imagecopy($photoFrame$logoImage$dest_x$dest_y00$logoW$logoH);
imagejpeg($photoFrame$targetfile); 
echo 
'<img src="'.$targetfile.'" />';
/**
* By santin1991[at]gmail[dot]com
**/
?>
כדי לשים את הלוגו על הקובץ הקיים בלי ליצור עוד קובץ, פשוט להחליף את targetfile
PHP קוד:
$targetfile $image_file
המשך יום טוב.
__________________
PHP קוד:
1337 (_)83||-|4><><0|
  Reply With Quote