<?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>Programming Ideas, Logics, Tips and Tricks &#187; resize</title>
	<atom:link href="http://www.sajithmr.me/tag/resize/feed" rel="self" type="application/rss+xml" />
	<link>http://www.sajithmr.me</link>
	<description></description>
	<lastBuildDate>Mon, 23 Jan 2012 15:44:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Online Photoshop in PHP (Series Part 3)</title>
		<link>http://www.sajithmr.me/online-photoshop-in-php-series-part-3</link>
		<comments>http://www.sajithmr.me/online-photoshop-in-php-series-part-3#comments</comments>
		<pubDate>Mon, 26 May 2008 15:30:47 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[implementation]]></category>
		<category><![CDATA[resize]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/online-photoshop-in-php-series-part-3/</guid>
		<description><![CDATA[Resize a Photo &#62;&#62; Today we will implement hows to resize photo into a particular width and height (or keeping aspect ratio) See the live example from: http://www.sajithmr.com/photoshop-tuts/resize/resize.php You need to install php-gd library to do this. To functions, imagecreatetruecolor and imagecopyresampled will do the resizing. Those who have not seen the Online Photo Editing [...]]]></description>
			<content:encoded><![CDATA[<h2>Resize a Photo &gt;&gt;</h2>
<p>Today we will implement hows to resize photo into a particular width and height (or keeping aspect ratio)</p>
<p>See the live example from: <a href="http://www.sajithmr.com/photoshop-tuts/resize/resize.php" target="_blank">http://www.sajithmr.com/photoshop-tuts/resize/resize.php</a></p>
<p>You need to install php-gd library to do this. To functions, <strong>imagecreatetruecolor</strong> and <strong>imagecopyresampled </strong>will do the resizing.</p>
<p>Those who have not seen the Online Photo Editing tool yet, have a look at: <a href="http://www.sajithmr.com/photoshop/index.php" title="Online Photo Editing Tool" target="_blank">http://www.sajithmr.com/photoshop/index.php </a></p>
<p>Here is the function:</p>
<pre lang="php">

function Resize($image,$new_width,$new_height=0)
{

 $old_width = imagesx($image);
 $old_height= imagesy($image);

 if($new_height==0) // if the height is not specified
                           //....calculate the relative height
 $new_height= $new_width * $old_height / $old_width ;

 $new_image= imagecreatetruecolor($new_width, $new_height);
 imagecopyresampled($new_image, $image, 0, 0, 0, 0, $new_width,
 $new_height, $old_width, $old_height);
 return $new_image;

}</pre>
<p>Here the $image is the object of the image which is created from the function<strong> imagecreatefromgif</strong>($path_to_photo), if the image is in GIF format.</p>
<p>Other functions are <strong>imagecreatefromjpeg</strong> and <strong>imagecreatefrompng</strong> for JPEG and PNG respectively .</p>
<p>Download Full source code for this example from: <a href="http://www.sajithmr.com/photoshop-tuts/resize.zip">http://www.sajithmr.com/photoshop-tuts/resize.zip</a></p>
<p>In the previous part we implemented browse photos area. <a href="http://www.sajithmr.com/online-photoshop-in-php-series-part-2/" target="_blank">http://www.sajithmr.com/online-photoshop-in-php-series-part-2/</a></p>
<p>In that for browsing picture files, we used full size image, instead of thumbnails. Here new example , in which browse photos is implemented with image thumbnails using resizing (150 px)</p>
<p>The difference is , instead of calling img tag&#8217;s src to the orginal image path,  called through resize.php?img=path_to_image ,  passed the image path as parameter to resize function.</p>
<p>See live example: <a href="http://www.sajithmr.com/photoshop-tuts/browse-resize/browse.php" target="_blank">http://www.sajithmr.com/photoshop-tuts/browse-resize/browse.php</a></p>
<p>Take the html and see the difference from old browse implementation: <a href="http://www.sajithmr.com/photoshop-tuts/browse.php" target="_blank">http://www.sajithmr.com/photoshop-tuts/browse.php </a></p>
<p>Which is fast ??</p>
<p>Download the full source code for browsing with image thumbnail  from: <a href="http://www.sajithmr.com/photoshop-tuts/browse-resize.zip" target="_blank">http://www.sajithmr.com/photoshop-tuts/browse-resize.zip</a></p>
<p>Keep reading for the coming series,  part 4 , <strong>Orkut Like Photo Cropping &gt;&gt;</strong></p>
<p>Subscribe to this website feed now:<br />
<a href="http://feeds.feedburner.com/sajithmr"><img src="http://www.sajithmr.com/downloads/rss2.png" height="100" width="100" /></a></p>
<p>Regards</p>
<p>Sajith M.R</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/online-photoshop-in-php-series-part-3/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Online Photoshop in PHP (Series Part 1)</title>
		<link>http://www.sajithmr.me/online-photoshop-in-php-series-part-1</link>
		<comments>http://www.sajithmr.me/online-photoshop-in-php-series-part-1#comments</comments>
		<pubDate>Tue, 20 May 2008 13:05:50 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[clear all]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[round]]></category>
		<category><![CDATA[save]]></category>
		<category><![CDATA[undo]]></category>
		<category><![CDATA[watermark]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/online-photoshop-in-php-series-part-1/</guid>
		<description><![CDATA[Introduction &#62;&#62; As i announced in my birthday post: celebrating-1st-year-of-sajithmr.com , i am starting my post series How to make Photoshop Express in PHP Before we starting the step by step procedure, have a look at : http://www.sajithmr.me/photoshop/index.php This is a basic version of online photo editing tool. You can either upload a photo to [...]]]></description>
			<content:encoded><![CDATA[<h1><span style="color: #339966;">Introduction &gt;&gt;</span></h1>
<p><a title="Online Photo Editing Tool" href="http://www.sajithmr.com/photoshop/index.php" target="_blank"><img src="http://www.sajithmr.com/wp-content/uploads/2008/05/screenshot1.jpg" alt="Online Photoshop in PHP (Series Part 1)" width="346" height="328" /></a></p>
<p>As i announced in my birthday post: <a title="1st Happy Birthday" href="http://www.sajithmr.com/celebrating-1st-year-of-sajithmrcom/" target="_blank">celebrating-1st-year-of-sajithmr.com</a> , i am starting my post series  <span style="text-decoration: underline;">How to make Photoshop Express  in PHP</span></p>
<p>Before we starting the step by step procedure, have a look at : <a title="Online Photoshop" href="http://www.sajithmr.me/photoshop" target="_blank">http://www.sajithmr.me/photoshop/index.php</a></p>
<p><a style="margin: 10px; float: left" href="http://www.sajithmr.com/photoshop/index.php" target="_blank"><img src="http://www.sajithmr.com/wp-content/uploads/2008/05/logo2.jpg" alt="" /></a></p>
<p>This is a basic version of online photo editing tool.</p>
<p>You can either upload a photo to this tool or you can browse some images already supplied.</p>
<p>The basic features are:</p>
<ol>
<li>Crop</li>
<li>Resize</li>
<li>Water marking (Both logo and text)</li>
<li>Round corner</li>
<li>Rotate</li>
<li>Download and save</li>
</ol>
<p><span style="text-decoration: underline;"> Try yourself</span></p>
<p>Upload some picture (or browse any picture), Press crop button (top left), you can see orkut photo upload like crop there. You can select the area, or drag anywhere in the image. Press crop button in the workdesk. (Press F11 or fullscreen view for better performance )</p>
<p>Try all other features provided.</p>
<p>The whole site is divided into four parts.</p>
<ol>
<li>Tools</li>
<li>Work Desk</li>
<li>Browse Photos</li>
<li>Settings</li>
</ol>
<p><strong>Tools area</strong> contains options for <span style="text-decoration: underline;">crop,</span> <span style="text-decoration: underline;">resize</span>, <span style="text-decoration: underline;">watermark,</span> <span style="text-decoration: underline;">round</span>, <span style="text-decoration: underline;">undo</span> , <span style="text-decoration: underline;">save,</span> <span style="text-decoration: underline;">clear all</span>, <span style="text-decoration: underline;">download</span>.</p>
<p><a href="http://www.sajithmr.com/photoshop/index.php" target="_blank"><img src="http://www.sajithmr.com/wp-content/uploads/2008/05/tool.jpg" alt="" /></a></p>
<p>Here <strong>&#8216;clear all&#8217;</strong> reset all the operations and navigate the website into initial settings.</p>
<p>From the <strong>Settings Area</strong>, You can fix the angle of the image. You can rotate either clock-wise or anti-clock-wise depending on the angle provided (+ve or -ve)</p>
<p><a href="http://www.sajithmr.com/photoshop/index.php" target="_blank"><img src="http://www.sajithmr.com/wp-content/uploads/2008/05/setting.jpg" alt="" /></a></p>
<p>In  <strong>Text Water Mark Setting Area</strong>, you can enter a text, set font size and font color. It generates a pictures corresponding to your text. Click water mark button in tool area and fix the position , press <strong>Apply Watermark </strong></p>
<p>You can also upload your water mark logo.</p>
<p>Finally you can download the edited picture by clicking download button in the Tool area (top right) .</p>
<p>The interesting thing is the whole website / tool is created in a single day.</p>
<p>wanna learn how to implement this ??</p>
<p>Keep reading rest of the series.</p>
<p>In <span style="color: #99cc00;"><span style="text-decoration: underline;"><strong>Online Photoshop in PHP (Series Part 2)</strong> </span></span> &gt;&gt; <span style="color: #ff6600;">Implementation of the <strong>Browse Photos</strong> Area</span></p>
<p>Thanks and Regards<br />
Sajith M.R</p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/online-photoshop-in-php-series-part-1/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

