<?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; crop</title>
	<atom:link href="http://www.sajithmr.me/tag/crop/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>Crop Image Like Orkut</title>
		<link>http://www.sajithmr.me/crop-image-like-orkut</link>
		<comments>http://www.sajithmr.me/crop-image-like-orkut#comments</comments>
		<pubDate>Thu, 05 Jun 2008 07:36:32 +0000</pubDate>
		<dc:creator>Mr Me</dc:creator>
				<category><![CDATA[Downloads]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php source code]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[orkut]]></category>

		<guid isPermaLink="false">http://www.sajithmr.com/crop-image-like-orkut/</guid>
		<description><![CDATA[Online Photoshop in PHP (Series Part 4) &#62;&#62; Today we will discuss about cropping of images using php and gd library. Look at the simple example here: http://www.sajithmr.com/photoshop-tuts/crop/simplecrop.php $x1 = $_GET['x1']; $y1 = $_GET['y1']; $x2 = $_GET['x2']; $y2 = $_GET['y2']; $image_object = imagecreatefromjpeg('hari.jpg'); $image_cropped = Crop($image_object,$x1, $y1, $x2,$y2); $temp_path = rand(1,99999)."hari.jpg"; imagejpeg( $image_cropped,$temp_path); header('Location: simplecrop.php?img='.$temp_path [...]]]></description>
			<content:encoded><![CDATA[<h3><font color="#008080">Online Photoshop in PHP (Series Part 4) &gt;&gt;</font></h3>
<p><img src="http://www.sajithmr.com/wp-content/uploads/2008/06/orkut.jpg" alt="Crop Image Like Orkut" /></p>
<p>Today we will discuss about cropping of images using php and gd library.</p>
<p>Look  at the simple example here:</p>
<p><a href="http://www.sajithmr.com/photoshop-tuts/crop/simplecrop.php" title="Orkut Like Crop" target="_blank">http://www.sajithmr.com/photoshop-tuts/crop/simplecrop.php</a></p>
<pre lang="php">

$x1 = $_GET['x1'];
$y1 = $_GET['y1'];

$x2 = $_GET['x2'];
$y2 = $_GET['y2'];	

$image_object =   imagecreatefromjpeg('hari.jpg');
$image_cropped =  Crop($image_object,$x1, $y1, $x2,$y2);
$temp_path = rand(1,99999)."hari.jpg";
imagejpeg( $image_cropped,$temp_path);

header('Location: simplecrop.php?img='.$temp_path );	  

?&gt;</pre>
<p>Here the Crop function is doing the real work.  x1 and y1 are Top-Left Coordinates of new image and  x2, y2 are the  Bottom-Right .</p>
<p>Here is the function for Crop</p>
<pre lang="php">
function Crop($image, $xpos1,$ypos1,$xpos2,$ypos2)
	{
		require_once('class.cropcanvas.php');
		$cc =&amp; new CropCanvas();
		$cc-&gt;loadImageFromObject($image);
		$cc-&gt;cropToDimensions($xpos1, $ypos1, $xpos2,$ypos2 );
		return $cc-&gt;getImageObject();

	}

?&gt;</pre>
<p>You can see the class.cropcanvas.php file from the attachment.</p>
<p>In the above example, we have to enter each coordinates manually. See the example below:</p>
<p><a href="http://www.sajithmr.com/photoshop-tuts/crop/realcrop.php" target="_blank">http://www.sajithmr.com/photoshop-tuts/crop/realcrop.php</a></p>
<p>Here  you can select the area by click and drag (like orkut)</p>
<p>This is implemented with the help or jslib javascript. The given attachment in the end of this post contains the all.</p>
<p><a href="http://www.sajithmr.com/photoshop-tuts/crop.zip">http://www.sajithmr.com/photoshop-tuts/crop.zip</a></p>
<p><a href="http://www.sajithmr.com/photoshop-tuts/crop.zip"><img src="http://www.sajithmr.com/wp-content/uploads/2008/05/winzip_180x180.thumbnail.gif" width="79" height="79" /></a></p>
<p>Keep reading for the further posts in this series.  Next post is on <strong>Intellegent watermarking</strong> on images.</p>
<p>Subscribe to my Feeds:<a href="http://www.sajithmr.com/feed/" target="_blank"> http://www.sajithmr.com/feed/</a></p>
<p><a href="http://www.sajithmr.com/feed/" target="_blank"><img src="http://www.sajithmr.com/downloads/rss2.png" width="80" height="80" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.sajithmr.me/crop-image-like-orkut/feed</wfw:commentRss>
		<slash:comments>19</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>

