BuffaloHELP
Apr 24 2006, 02:46 AM
This script was found on the net http://tips-scripts.com/?tip=watermark#tip B&T's Tips & Scripts site. Just in case the site may not show, I will include the code here: List of things needed: 1. your image in any format 2. watermark image--in gif format with transparent background 3. script below with name (i.e. watermark.php) CODE <?php // this script creates a watermarked image from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly transparent gif image with the watermark - goes in the same directory as this script // where this script is named watermark.php // call this script with an image tag // <img src="watermark.php?path=imagepath"> where path is a relative path such as subdirectory/image.jpg $imagesource = $_GET['path']; $filetype = substr($imagesource,strlen($imagesource)-4,4); $filetype = strtolower($filetype); if($filetype == ".gif") $image = @imagecreatefromgif($imagesource); if($filetype == ".jpg") $image = @imagecreatefromjpeg($imagesource); if($filetype == ".png") $image = @imagecreatefrompng($imagesource); if (!$image) die(); $watermark = @imagecreatefromgif('watermark.gif'); $imagewidth = imagesx($image); $imageheight = imagesy($image); $watermarkwidth = imagesx($watermark); $watermarkheight = imagesy($watermark); $startwidth = (($imagewidth - $watermarkwidth)/2); $startheight = (($imageheight - $watermarkheight)/2); imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?> Name this script, i.e. watermark.php and call this script as following: HTML <img src="watermark.php?path=image_name.filetype"> the only thing you need to chage is "image_name.filetype" and of course you can have the relative path such as: HTML <img src="folder/watermark.php?path=folder/imagename"> The caution here is the script watermark.php and watermark.gif should be in the same location. watermark.gif should have transparent background. As you can read it from the site, the location where the watermark.gif appears can be modified by adjusting this line of the code: CODE $startwidth = (($imagewidth - $watermarkwidth)/2); $startheight = (($imageheight - $watermarkheight)/2); To have it appear on the bottom right corner, try this: CODE $startwidth = (($imagewidth - $watermarkwidth) ); $startheight = (($imageheight - $watermarkheight) ); Personal note: I have installed Apache2 and PHP5 in my computer and couldn't get this working at first. Later I found out I had to edit php.ini under extension to enable php_gd2.dll in order to make it work under http://localhost/I hope you find a good usage out of this 
Comment/Reply (w/o sign-up)
Dooga
Apr 24 2006, 03:21 AM
Hey this can be really useful when it comes to using images. You no longer have to make a watermark for every image that you make in image editing software! Now, does this work with hotlinks? It would be cool if I can put a watermark on an imageshack uploaded image or a hotlinked banner etc...
Comment/Reply (w/o sign-up)
BuffaloHELP
Apr 24 2006, 03:32 AM
Do you mean like this? HTML <img src="watermark.php?path=http://site/image.type"> I tested it out and what do you know, it works... wow good question and what a find! But remember that watermark.gif should be with watermark.php in the same location. I wonder if the script can be modified so that the watermark.gif can be located elsewhere...? For those PHP gurus out there, see if you can modify this script so that you can use different watermark.gif images. So that we can use one line command such that you can use multiple or alternate watermark.gif images: HTML <img src="watermark.php?mark=watermark.gif_location&path=image_location"> Again, since I am very new to PHP programming, I'm assuming two different var can be called in one command. So basically, the command would be like: "watermark script, location of watermark.gif, location of image"
Comment/Reply (w/o sign-up)
Dooga
Apr 24 2006, 03:36 AM
Muwhaha now I can steal the Trap17 sigs and said I made them!! I'm just kidding... but it is a very useful find!
Comment/Reply (w/o sign-up)
WindAndWater
Apr 24 2006, 05:35 AM
Here's one with a variable path as requested. It works on my Trap17 account. I cleaned up the code, added some idiot proofing, and made it so that the watermark could be a .png which also supports alpha channels (transparency) and which won't dither like gifs do. Like the original, it only supports images with .gif/.jpg/.jpeg/.png extensions. I left the original author's (bad) naming scheme. CODE <?php // this script creates a watermarked image from an image file - can be a .jpg .gif or .png file // where watermark.gif is a mostly transparent gif image with the watermark - goes in the same directory as this script // where this script is named watermark.php // call this script with an image tag // <img src="watermark.php?path=imagepath"> where path is a relative path such as subdirectory/image.jpg $imagesource = $_GET['path']; $watermarkPath = $_GET['watermark']; $filetype = substr($imagesource,strlen($imagesource)-4,4); $filetype = strtolower($filetype); $watermarkType = substr($watermarkPath,strlen($watermarkPath)-4,4); $watermarkType = strtolower($watermarkType); if($filetype == ".gif") $image = @imagecreatefromgif($imagesource); else if($filetype == ".jpg" || $filetype == "jpeg") $image = @imagecreatefromjpeg($imagesource); else if($filetype == ".png") $image = @imagecreatefrompng($imagesource); else die(); if(!$image) die(); if($watermarkType == ".gif") $watermark = @imagecreatefromgif($watermarkPath); else if($watermarkType == ".png") $watermark = @imagecreatefrompng($watermarkPath); else die(); if(!$watermark) die(); $imagewidth = imagesx($image); $imageheight = imagesy($image); $watermarkwidth = imagesx($watermark); $watermarkheight = imagesy($watermark); $startwidth = (($imagewidth - $watermarkwidth)/2); $startheight = (($imageheight - $watermarkheight)/2); imagecopy($image, $watermark, $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight); imagejpeg($image); imagedestroy($image); imagedestroy($watermark); ?> It can be accessed by using CODE <img src="watermark.php?path=imagePath.ext&watermark=watermarkPath.gif> or <img src="watermark.php?path=imagePath.ext&watermark=watermarkPath.png> edit: Removed a "." and now the entire script's correct.
Comment/Reply (w/o sign-up)
BuffaloHELP
Apr 24 2006, 07:41 AM
WindAndWater, Oh good lord! That worked beautifully! Thank you. And you're right: although I would not use png at this moment (since my watermark will be simple and small) the need for making a script that can be adaptable is very crucial to a perfect script. Thanks again!
Comment/Reply (w/o sign-up)
Saint_Michael
Apr 24 2006, 09:18 AM
hmmm interesting script but from what I search up on this type of script you can use gd support and also htaccess as well to make your water makr even more dynamic and what not. here are some example links htaccess versiongd support
Comment/Reply (w/o sign-up)
Sprnknwn
Apr 24 2006, 01:35 PM
Cool. I didnŽt know that you could do that with a php script. Thanks for showing it to us, maybe IŽll give it a try.
Comment/Reply (w/o sign-up)
BuffaloHELP
Apr 24 2006, 03:10 PM
QUOTE edit: Removed a "." and now the entire script's correct.
WindAndWater, Where did you remove your "dot"? Because the first script worked just fine form me. If you are referring to JPEG, who actually uses JPEG extension today except for avi purpose?
Comment/Reply (w/o sign-up)
WindAndWater
Apr 24 2006, 09:41 PM
Yup I removed the . so that it reads "jpeg" as opposed to ".jpeg" which is 5 characters long, so it will never match a 4 character extension. Truthfully probably no-one uses .jpeg anymore, but it's an old habit that I haven't kicked yet. :-)
Comment/Reply (w/o sign-up)
iGuest
May 19 2009, 06:01 PM
Not supporting watermark through hosting server
Watermark Your Image With Simple Php Script
hi
For our site, presently it has pre compiled ffmpeg file for converting to flv video file. But it does not support water mark on video for existing hosting server. If it has to support water mark then we have to support ffmpeg library. It should have in our site server's. Aready we have made request to hosting server for supporting ffmpeg library, Even though they are saying that 'We do not have ffmpeg installed, but you are free to upload a pre-compiled Linux binary to their home directory and reference it in their code from there."'
please solve the problem if anybody
-reply by ratnakarraju
Comment/Reply (w/o sign-up)
iGuest
Mar 14 2009, 03:51 PM
I need a script that adds text based watermark to downloaded image
Watermark Your Image With Simple Php Script
Hello
many thanks for people who post useful code on this board and educate us on how to do things.
I am a photographer and I need a php script to run on my web site to stamp user id or mail address of my visitors/members when they download my photos.
The watermark source will be text only stating that "This picture was downloaded by (visitors e mail address _ here) from (my site name_here ) "
I wish also that this info could be squeezed somewhere in the exif field of the original jpeg photo that can come up upon examination generated on the fly when the file is being packaged with the watermark prior to download starts.
Think of it as a similar script like the rapidshare or megaupload download script that masks the actual location of the image on the server so the picture can not be accessed or discovered by a possible google spidered direct link.
My motivation on doing this is simply to discourage lamers who re-upload my material and give away for free on bbs and forums without credit where it is due. I want to make it a bit more difficult for them and easier to track them down from the exif.
Does anyone have written any code to do this? or have any idea on how to code this
I know some php but I am totally nul as far as coding graphics
thanks
Comment/Reply (w/o sign-up)
Sandeep Singh
Jan 3 2009, 10:24 PM
Thanks a lot as i really needed that script.Please update me with newer scripts. Thank you.
Comment/Reply (w/o sign-up)
iGuest
Dec 12 2008, 12:45 PM
iGuest
Aug 2 2008, 06:53 PM
Doesn\\
Watermark Your Image With Simple Php Script
If everytime someone accesses an image needing watermark it requires the server to process 2 images together on every request. Wouldn't it be better to place that script in a folder of unwatermarked images and it can read each image and move it to the watermarked directory, so it only has to process the watermark code once for each image instead of thousands of times. I am incorporating the watermark specific code into an photo gallery admin section where a user uploads a photo, it resizes it to the max allowed size, then resizes it again to produce a thumbnail version and then applies the watermark to the first resized image. -reply by Justin Anderson
Comment/Reply (w/o sign-up)
Similar Topics
Keywords : watermark, image, simple, php, script, found, net
- How To Make Php Newsletter Script
(3)
Php Guest Online Script
(3) make an index.php copy and paste this code CODE $db_host = "localhost"; $db_user = "root";
$db_pass = ""; $db_name = "test"; $dbc = mysql_connect($db_host, $db_user, $db_pass); $dbs =
mysql_select_db($db_name); $tm = time(); $timeout = $tm - (30*60); if($_SERVER ){$ip=$_SERVER ;}
else{$ip=$_SERVER ;} $brws = explode("(",$_SERVER ); $browser = $brws ; mysql_query("DELETE FROM
guest WHERE actvtime mysql_query("INSERT INTO guest SET time='".$tm."',
ip='".$ip."', browser='".$browser."'"); $count =
mysql_fetch_array(mysql_query("SELECT COUNT(*)....
How To Make A View New Post Script?
(5) Ok so i'm still working on the forum software i posted about a while back, but I have no idea
how to do this. I want to make a view new post script, as this is one of the main things that my
forum software dose not have that all other forums have. so does any body have an idea on how i
would do this? Thanks.....
Guessing Php Script
(2) I am looking for: freeware php quess the person in the photo game script....
Image Upload
?!? (11) I need the image upload script which automatically resized the image by specified size and store it
in the specified folder.....
Need Help Installing Dolphin Community Script!
(5) I'm not sure if this is the right place to post this but I really need help in installing the
dolphin community script. I have absolutely no previous experience of scripts or programming. I
would really appreciate if someone could walk me through it step-by-step, or even do it for me by
logging into my cpanel. I have tried to install it my self but I'm a little confused. I'm
sure it won't take very long at all for someone who has done this before.....
How Do I Connect To Live Database With Php Script?
while being hosted with ComputingHost (6) I am not new to programming. I want to create a form to add some values into my tables, the code
are all working. But I am not sure what is the URL to connect to my site's database. All along,
I have been testing through MAMP, which provides a local copy of mySQL. Can anyone lend me a hand?....
Download Script For Mp3 Files
(0) Hello, I'm looking for a download script for sound files (e.g. mp3, avi, wma, and other ones).
i have found a few download scripts but they would not work for sound files for some reason. also
this will not be used for allowing downloading of illegal or riped music, what i will be using this
script for is i'm making a site for my church and the pastor wants to be able to recored the
services and then have me upload them to the site so that the church members can download them for
what ever reason. If some one could tell me how to make one or could show me a plac....
Php Rediret Script
(12) Ok, what I am trying to do is this. Re-direct a domain name called: avalon.asn.au to
preschool.stmarksavalon.org.au I have created a script that will re-direct within the a folder.
However, the avalon.asn.au and stmarksavalon.org.au are PARKED Domains. Any ideas on how to create
this PHP Redirect Script please?....
Forum Script
(3) Hello, i'm wanting to start making my own forum software but i dont know where to start or what
i need to know in order to do this. I know i will need php and mysql but what else, and could some
one point me to a good site were i could learn php and mysql. Thanks ....
How Would I Go About Making A Simple "counting" Script?
(3) I plan on making a script for basic voting between different options, and I'd like to know what
PHP coding I would require. Basically, each choice will be as simple as this: CODE Best
falsetto? Person A Person B What PHP would be used to basically add 1 value to a
specified .txt file based on which option is chosen? (Like, if person A was selected, it would add 1
to persona.txt, and if person B was chosen, it would add 1 to personb.txt) Thanks in advance to
whoever helps. I'm not good at this kind of intermediate/advanced PHP. /ph34r.gi....
Library Script
Where? (6) Hello, everyone. Anyone knows where I can get a library script that acts like CMS script software,
you can add books or delete them. I want to build virtual online library which can be accessible to
everyone. Or just give me some advices how to make it build. I'm a novice in programming.....
Script Not Working
I don't know why. (6) For some reason my random string script is not working. I got a fatal error when I tried it under
XAMPP. I do not know why. It looks syntatically correct. Could someone help me? Here is the script:
(Warning its over 100 lines long) //This PHP script will generate a random array and turn it into
a string consisting of 0-9 and A-Z. // This is the first developmental version. //Create 10 item
array for string $string = array(0,0,0,0,0,0,0,0,0,0); //Create function to replace 10-36 with A-Z
function conToStr() { for ($a = 0;$a switch($string ) { case 10: $str....
Script Help Required: Undefined Variable
A fault I cannot spot in PHP (3) Hi, when running a PHP script I keep getting the error: QUOTE Notice: Undefined variable: bret
in c:\program files\easyphp1-8\home\poll.php on line 294 Notice: Undefined variable: bret in
c:\program files\easyphp1-8\home\poll.php on line 294 (And, yes, I get it twice). The code
related to the variable is as follows: CODE function LogString($string,$type) {
$t_log = "\n"; $t_log .= $this->globaldata->server_vars ."|";
$t_log .= date("Y-m-d h:i:s A|"); $t_log .= "$type| "; $string =
str_replace("\n","\\n",$s....
Php Downloads Script
(4) I've been looking all over the net for a PHP script which can provide an interface to browse a
downloads database. The database could be powered by MySQL. If you know a script like this, please
post it here. Thanks in advance, Ironchicken.....
Will This Code Work
php linking script ?p= (5) hi i'm not that great at php so i'm not to sure if this will work or not. but what i want to
do is be able to use ?p=staff or what ever page name, with out the php extion, and i would like to
no if this simple script i made would work. the code is: CODE $p = $_GET ; if ( !empty($p) &&
file_exists('./' . $p . '.php') && stristr( $p, '.' ) == False ) { // pages
= directory where you store your pages $file = './' . $p . '.php'; } else { //
1.php = defult page $file = './index.php'; } include $file; ?> ....
Html Code Tester. Online Script
(15) Yes, yes. I have another script that I have written and I am distributing. I am not entirely sure if
this works. I have not tested it yet, but I will later and post back with a demo and fix it up.
Current script: CODE //Save this as something like htmltest.php function CheckForm() {
$html_unsafe=$_POST ; //Gives us our user input $html_safe=str_replace(" //Starts security measures
$html_safe=str_replace("?>"," ",$html_safe); //User input now secure server side //Still security
issues client side echo $html_safe; //echos our statement } //End function //Main script....
Very Simple Online Now Script
This is a very simple online now script. (4) Hi all, Its Aldo. anyways, I wont be using the method of pagination, i will just tell you how to
make a basic online now script. When someone logs in, now take into consideration that the name of
the username input is username ( First ,create a table in your database saying online now and add 2
fields to it. id and username CODE id type=integer(INT) , auto increment, length =255 and
username = VARCHAR length=the limit a username should be in your site now from there we take off
: CODE //logged.php //authentication script //connection script //if connectio....
Creatting A Playlist Through Php
script help needed (5) Hi I am trying to make a script so that i can insert songs into a playlist, but i need a script in
which it opens the playlist file and removes the closing tag at the end, so before i can add more
entrys. e.g CODE Location 5 Location 4 Location 3 Location 2 Location 1 But to
add more entrys i would have to get rid of the atx, then use the fputs to place the new entry into
the file. code tags added Topic title modified. ....
What Kind Of Script Do You Need ?
post here and get free script (15) Hi everybody sorry if i posting here , i know I want design free PHP script and i dont know
webmasters what kind of scripts want i think its better to aks here becuase trap17 is very nice
webmasters forum So , Plz post here what kind of script with details you need ! sorry may en is
not very well for example you need "upload center" : write "upload center" with upload center
options ( like Ajax , Fast , multi lan and ... ) with this post we can give script details and
webmasters idea /smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif"....
Wappy Buddy V1.10 - Tibia Gold Edition By Wappy & Jon Roig
the official wap download script (3) By downloading this script you are agreeing to the license and terms outlined below /biggrin.gif"
style="vertical-align:middle" emoid=":D" border="0" alt="biggrin.gif" /> QUOTE /** * *
@package: wappyBUDDY - Tibia Gold Edition * @version: 1.10 2006/10/01 00:00:01 wappy * @copyright:
©2003, 2006 jon roig, wappy * @release notes: this is the first official release of my download
script despite pirate and incomplete copies floating around that were stolen from one of my previous
servers. The next release will follow very shortly * @terms: wappyBUDDY is free softw....
Free Auction Script
Any Suggestions? (7) Any free auction script suggested? I want it to be as many practical functions as possible, yet
easy to manage. And more importantly, it is free! Appreciate your kind suggestions!....
Wappychat_oldskool
old version of my wap chat script :-) (15) here is a very old version of my wap chat script, its not very advanced but has privates, smileys
etc. I will post some further versions (with owner, admin, mod status and profiles) when i have time
to write the readme/install instructions for them. You will find instructions inside the zip. If you
have any problems post here but i know it don't work on all servers for some reason but it does
work on the trap server so will be cool ok /tongue.gif" style="vertical-align:middle" emoid=":P"
border="0" alt="tongue.gif" /> ....
Script That Tracks The User Status
how can I track on or offline users? (4) long explaination: hey, I'm building a user profile site right now. And, I kinda know how to
make a online/offline detector, but not totally sure. I know I can make a mysql database to track
them, but how does it entrer the information? I could easily put in a field where when they login it
sets them to online, but if they don't sign out, and just exit the browser, how can I tell.
short: I want someone to tell me how to make a online/offline status detector, like they have here
on trap17. I'd be thrilled if you can post to this, thanks, arcticsnpr....
Dynamic Image / Signature Generator
a simple code to change text on an image (12) In search of dynamically changing quote, saying or all other types of text on an image I came across
a code that I have modified to fit my initial usage. This procedure requires two files and short
knowledge of PHP. If you are familiar with Trap17's sig rotation code you will understand this
procedure very fast. Code 1: dynamic_sig.php (you can rename this to index.php and you'll see
at the end why) Code 2: a simple text file named anything (I will call it name.txt ) Code 1
CODE header("Content-type: image/png"); $image = imagecreatefrompng("../i....
Transfer Variables To Another Php Script
(11) Hello, I've one registration page where the users fills in their information, is it possible to
trasnfer the things the fill in on the registration page to another script that does someting and
returnes something to the first page like true/false and then the registration gives an error
messange if the other php script returned false? Something like the script "activates" another
script that does something and returnes the result back to the original script. Best Regards ....
Parse: Error Unexpected T_lnumber
php parse error when running script (4) Hi. I've just created a php script. The main object of the script is to delete some old files
and replace it with a new file with some new content, effectively moving the contents from one file
to another. These are the first 50 lines of the file: /* Calculate For The "A" Group - The
Latest Games ID */ $a_B = 002; while(file_exists("a_" . $a_B . ".dat")) { $a_B++; }
$new_page_contents = " " . $_POST . " " . $_POST . " include
\"/home/cmatcme/public_html/footer.php\"; ?> "; $a_stream = fopen($a_B . ".cmat", "w+");
fwri....
Php News Script
how to make news script that uses MySQL writen in PHP (20) How to make a News script with PHP + MySQL So..in this tutorial i will explain how to create PHP
news script. first we have to create the table in My SQL.. with the code below you will do this (
you have to enter it into SQL field ..in PHPmyADMIN) CODE CREATE TABLE news ( id int(10)
unsigned NOT NULL auto_increment, postdate timestamp(14) NOT NULL, title varchar(50) NOT NULL
default '', content text NOT NULL, PRIMARY KEY (id), KEY postdate (postdate), FULLTEXT KEY
content (content) ) >>>> script files 1 file will show the news ,1 file will....
Script: Php Jukebox
A one file script! (6) This scripts is so simple, you dont need to edit ANY of it! All you have to do is make a folder
called 'songs' and put some audio files in it. Here is the whole page, I named it index.php
and put it in a folder called 'music': CODE PHP jukebox ©2005 Craig lloyd.
All rights reserved. Visit cragllo.com for more scripts --> /** * ©2005 Craig lloyd. All rights
reserved. * * Mod Title: Simple PHP Jukebox * Author: Craig Lloyd * Author
Email: cragllo@cragllo.com * Author Homepage: http://www.cragllo.com/ * Des....
Many Php Script Sites
(18) Hi I find many sites has PHP scripts :: QUOTE http://www.proxy2.de/scripts.php
http://www.free-php.net http://knubbe.t35.com/ http://www.ngcoders.com/
http://www.oxyscripts.com/ http://www.phparena.net/ http://www.1phpstreet.com/
http://px.sklar.com/ http://www.scoznet.com/ http://php.resourceindex.com/ /blink.gif"
style="vertical-align:middle" emoid=":blink:" border="0" alt="blink.gif" />....
Looking for watermark, image, simple, php, script, found, net
|
Searching Video's for watermark, image, simple, php, script, found, net
See Also,
|
advertisement
|
|