<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Evil Science &#187; watermark</title>
	<atom:link href="http://www.evilscience.org/tag/watermark/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.evilscience.org</link>
	<description>Internet, technology, seo, design and general IT things...</description>
	<lastBuildDate>Thu, 24 Dec 2009 11:21:44 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Simple Watermarking Script in PHP</title>
		<link>http://www.evilscience.org/simple-watermarking-script-in-php/</link>
		<comments>http://www.evilscience.org/simple-watermarking-script-in-php/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 15:06:45 +0000</pubDate>
		<dc:creator>Hellas</dc:creator>
				<category><![CDATA[PHP/MySQL/HTML/CSS]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[watermark]]></category>

		<guid isPermaLink="false">http://www.evilscience.org/?p=48</guid>
		<description><![CDATA[Recently i needed to modify some script and add watermark functionality. I googled and found few solutions, but this was most easiest for me to implement. Here is the simple php script for watermarking images.  You will need to create watermark.gif transparent image in photoshop.
&#60;br /&#62;
&#60;?php&#60;br /&#62;
// this script creates a watermarked image from [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Recently i needed to modify some script and add watermark functionality. I googled and found few solutions, but this was most easiest for me to implement. Here is the simple php script for watermarking images.  You will need to create watermark.gif transparent image in photoshop.<span id="more-48"></span></p>
<pre class="brush: php">&lt;br /&gt;
&lt;?php&lt;br /&gt;
// this script creates a watermarked image from an image file - can be a .jpg .gif or .png file&lt;br /&gt;
// where watermark.gif is a mostly transparent gif image with the watermark - goes in the same directory as this script&lt;br /&gt;
// where this script is named watermark.php&lt;br /&gt;
// call this script with an image tag&lt;br /&gt;
// &lt;img src=&quot;watermark.php?path=imagepath&quot;&gt; where path is a relative path such as subdirectory/image.jpg&lt;br /&gt;
$imagesource =  $_GET[&#039;path&#039;];&lt;br /&gt;
$watermarkPath = $_GET[&#039;watermark&#039;];&lt;br /&gt;
$filetype = substr($imagesource,strlen($imagesource)-4,4);&lt;br /&gt;
$filetype = strtolower($filetype);&lt;br /&gt;
$watermarkType = substr($watermarkPath,strlen($watermarkPath)-4,4);&lt;br /&gt;
$watermarkType = strtolower($watermarkType);&lt;/p&gt;
&lt;p&gt;    if($filetype == &quot;.gif&quot;)&lt;br /&gt;
$image = @imagecreatefromgif($imagesource);&lt;br /&gt;
else&lt;br /&gt;
if($filetype == &quot;.jpg&quot; || $filetype == &quot;jpeg&quot;)&lt;br /&gt;
$image = @imagecreatefromjpeg($imagesource);&lt;br /&gt;
else&lt;br /&gt;
if($filetype == &quot;.png&quot;)&lt;br /&gt;
$image = @imagecreatefrompng($imagesource);&lt;br /&gt;
else&lt;br /&gt;
die();  &lt;/p&gt;
&lt;p&gt;    if(!$image)&lt;br /&gt;
die();&lt;/p&gt;
&lt;p&gt;    if($watermarkType == &quot;.gif&quot;)&lt;br /&gt;
$watermark = @imagecreatefromgif($watermarkPath);&lt;br /&gt;
else&lt;br /&gt;
if($watermarkType == &quot;.png&quot;)&lt;br /&gt;
$watermark = @imagecreatefrompng($watermarkPath);&lt;br /&gt;
else&lt;br /&gt;
die();&lt;/p&gt;
&lt;p&gt;    if(!$watermark)&lt;br /&gt;
die();&lt;/p&gt;
&lt;p&gt;    $imagewidth = imagesx($image);&lt;br /&gt;
$imageheight = imagesy($image);&lt;br /&gt;
$watermarkwidth =  imagesx($watermark);&lt;br /&gt;
$watermarkheight =  imagesy($watermark);&lt;br /&gt;
$startwidth = (($imagewidth - $watermarkwidth)/2);&lt;br /&gt;
$startheight = (($imageheight - $watermarkheight)/2);&lt;br /&gt;
imagecopy($image, $watermark,  $startwidth, $startheight, 0, 0, $watermarkwidth, $watermarkheight);&lt;br /&gt;
imagejpeg($image);&lt;br /&gt;
imagedestroy($image);&lt;br /&gt;
imagedestroy($watermark);&lt;br /&gt;
?&gt;&lt;br /&gt;
</pre>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.evilscience.org/simple-watermarking-script-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
