<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Resize and Crop Photos with PHP&#8217;s GD Library</title>
	<atom:link href="http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/feed/" rel="self" type="application/rss+xml" />
	<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/</link>
	<description>Web Development - Linux Administration - Networking</description>
	<lastBuildDate>Sun, 11 Mar 2012 03:43:34 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: France</title>
		<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/comment-page-1/#comment-12071</link>
		<dc:creator>France</dc:creator>
		<pubDate>Wed, 22 Dec 2010 16:43:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.uncontentio.us/?p=250#comment-12071</guid>
		<description>Hello Joyce,
just to say that after one year I&#039;m still using your wonderful script, thanks again and merry christmas!
France</description>
		<content:encoded><![CDATA[<p>Hello Joyce,<br />
just to say that after one year I&#8217;m still using your wonderful script, thanks again and merry christmas!<br />
France</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joyce</title>
		<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/comment-page-1/#comment-3835</link>
		<dc:creator>Joyce</dc:creator>
		<pubDate>Thu, 19 Nov 2009 13:21:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.uncontentio.us/?p=250#comment-3835</guid>
		<description>Hi France,

I did not include an option to specify quality in the class, since the default seems to work well for web use.  However, PHP&#039;s imagejpeg function, which called as one of the steps in the class&#039;s resize function, does take an optional quality parameter.  You would obviously have to update the class to use it.  Check out the &lt;a href=&quot;http://us.php.net/manual/en/function.imagejpeg.php&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;PHP manual&lt;/a&gt; for details.

Thanks for your comment!</description>
		<content:encoded><![CDATA[<p>Hi France,</p>
<p>I did not include an option to specify quality in the class, since the default seems to work well for web use.  However, PHP&#8217;s imagejpeg function, which called as one of the steps in the class&#8217;s resize function, does take an optional quality parameter.  You would obviously have to update the class to use it.  Check out the <a href="http://us.php.net/manual/en/function.imagejpeg.php" target="_blank" rel="nofollow">PHP manual</a> for details.</p>
<p>Thanks for your comment!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: France</title>
		<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/comment-page-1/#comment-3821</link>
		<dc:creator>France</dc:creator>
		<pubDate>Wed, 18 Nov 2009 14:53:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.uncontentio.us/?p=250#comment-3821</guid>
		<description>Hello Joyce,
is it possible to increase the quality of the uploaded resized image?
I imagine I have to change something in photo.php but can&#039;t find what to change..

Thanks.
France</description>
		<content:encoded><![CDATA[<p>Hello Joyce,<br />
is it possible to increase the quality of the uploaded resized image?<br />
I imagine I have to change something in photo.php but can&#8217;t find what to change..</p>
<p>Thanks.<br />
France</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joyce</title>
		<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/comment-page-1/#comment-3690</link>
		<dc:creator>Joyce</dc:creator>
		<pubDate>Tue, 10 Nov 2009 18:24:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.uncontentio.us/?p=250#comment-3690</guid>
		<description>Emmanuel &amp; France: Thank you for your comments! I&#039;m glad this is proving useful to you!</description>
		<content:encoded><![CDATA[<p>Emmanuel &#038; France: Thank you for your comments! I&#8217;m glad this is proving useful to you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: France</title>
		<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/comment-page-1/#comment-3689</link>
		<dc:creator>France</dc:creator>
		<pubDate>Tue, 10 Nov 2009 18:09:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.uncontentio.us/?p=250#comment-3689</guid>
		<description>Thank you so much Joyce, the crop function is what I was trying to do for days and days, I was going to give up!
:-)

France</description>
		<content:encoded><![CDATA[<p>Thank you so much Joyce, the crop function is what I was trying to do for days and days, I was going to give up!<br />
 <img src='http://fourmilestomay.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>France</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emmanuel</title>
		<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/comment-page-1/#comment-3686</link>
		<dc:creator>Emmanuel</dc:creator>
		<pubDate>Tue, 10 Nov 2009 16:39:42 +0000</pubDate>
		<guid isPermaLink="false">http://www.uncontentio.us/?p=250#comment-3686</guid>
		<description>Hey Joyce, thank you for this class, we are using it on our intranet and it works flawlessly!

Have a good day.</description>
		<content:encoded><![CDATA[<p>Hey Joyce, thank you for this class, we are using it on our intranet and it works flawlessly!</p>
<p>Have a good day.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joyce</title>
		<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/comment-page-1/#comment-3671</link>
		<dc:creator>Joyce</dc:creator>
		<pubDate>Mon, 09 Nov 2009 13:06:24 +0000</pubDate>
		<guid isPermaLink="false">http://www.uncontentio.us/?p=250#comment-3671</guid>
		<description>Hi Gareth,

I hope I am answering your question... There are two steps in cropping a picture.  First you have to instantiate the photo object and you do that by passing the $_FILES[&#039;image&#039;] array to the class constructor like this:

$photo = new Photo($_FILES[&#039;image&#039;]);

Then  you have to pass the height and width you would like to crop the image to and the directory where you want to store the cropped image to the doCenterCrop function.

I have not set up the class to run a succession of cropping and resizing functions against a photo, but I think you could do it, either by checking out the GD functions at php.net or by resizing using my class, and then cropping. When you do the crop, you&#039;d have to re-instantiate the class using the resized photo.  It may take some fiddling with the class to get it to work.  You&#039;ll have to try it out.  

I hope this helps!

Joyce</description>
		<content:encoded><![CDATA[<p>Hi Gareth,</p>
<p>I hope I am answering your question&#8230; There are two steps in cropping a picture.  First you have to instantiate the photo object and you do that by passing the $_FILES['image'] array to the class constructor like this:</p>
<p>$photo = new Photo($_FILES['image']);</p>
<p>Then  you have to pass the height and width you would like to crop the image to and the directory where you want to store the cropped image to the doCenterCrop function.</p>
<p>I have not set up the class to run a succession of cropping and resizing functions against a photo, but I think you could do it, either by checking out the GD functions at php.net or by resizing using my class, and then cropping. When you do the crop, you&#8217;d have to re-instantiate the class using the resized photo.  It may take some fiddling with the class to get it to work.  You&#8217;ll have to try it out.  </p>
<p>I hope this helps!</p>
<p>Joyce</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Rees</title>
		<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/comment-page-1/#comment-3629</link>
		<dc:creator>Gareth Rees</dc:creator>
		<pubDate>Fri, 06 Nov 2009 17:42:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.uncontentio.us/?p=250#comment-3629</guid>
		<description>Also is it possible to do a Center Crop which is propositional. i.e. I have pictures of cars 160x120 as they usually are wide image.

Which i&#039;d guess result in just showing the door - is it possible to do a full crop until the biggest x or y is met -  then do center crop so that there is only a small amount of clipping usually on the sides? as the smallest would be 120?

I think the above sounds right :)
Thanks for your time!</description>
		<content:encoded><![CDATA[<p>Also is it possible to do a Center Crop which is propositional. i.e. I have pictures of cars 160&#215;120 as they usually are wide image.</p>
<p>Which i&#8217;d guess result in just showing the door &#8211; is it possible to do a full crop until the biggest x or y is met &#8211;  then do center crop so that there is only a small amount of clipping usually on the sides? as the smallest would be 120?</p>
<p>I think the above sounds right <img src='http://fourmilestomay.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Thanks for your time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gareth Rees</title>
		<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/comment-page-1/#comment-3628</link>
		<dc:creator>Gareth Rees</dc:creator>
		<pubDate>Fri, 06 Nov 2009 17:29:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.uncontentio.us/?p=250#comment-3628</guid>
		<description>Hi Joyce,

In the above you currently have this:

$photo = new Photo(array(&#039;name&#039;=&gt;&#039;mydirectory/myfile&#039;,&#039;tmp_name=&gt;&#039;mydirectory/myfile&#039;));
     $width = 190;
     $height = 131;
     $photo-&gt;doCenterCrop($width,$height);

A) Do i replace the original line from: $photo = new Photo($_FILES[&#039;image&#039;]);

I am not sure that the whole:  array(&#039;name&#039;=&gt;&#039;mydirectory/myfile&#039;,&#039;tmp_name=&gt;&#039;mydirectory/myfile&#039;) part is or as to where the additional code,  Can you just detail where i should add the insertion? :)

Thank you</description>
		<content:encoded><![CDATA[<p>Hi Joyce,</p>
<p>In the above you currently have this:</p>
<p>$photo = new Photo(array(&#8216;name&#8217;=&gt;&#8217;mydirectory/myfile&#8217;,'tmp_name=&gt;&#8217;mydirectory/myfile&#8217;));<br />
     $width = 190;<br />
     $height = 131;<br />
     $photo-&gt;doCenterCrop($width,$height);</p>
<p>A) Do i replace the original line from: $photo = new Photo($_FILES['image']);</p>
<p>I am not sure that the whole:  array(&#8216;name&#8217;=&gt;&#8217;mydirectory/myfile&#8217;,'tmp_name=&gt;&#8217;mydirectory/myfile&#8217;) part is or as to where the additional code,  Can you just detail where i should add the insertion? <img src='http://fourmilestomay.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Joyce</title>
		<link>http://fourmilestomay.com/2009/resize-crop-photos-php-gd-library/comment-page-1/#comment-3609</link>
		<dc:creator>Joyce</dc:creator>
		<pubDate>Thu, 05 Nov 2009 13:19:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.uncontentio.us/?p=250#comment-3609</guid>
		<description>Hi Gareth, Sorry it&#039;s taken me so long to get back to you.  Can you be more specific regarding the problem you are having? The syntax is as follows:

$photo-&gt;doCenterCrop(final_width, final_height, path_to_directory_to_store_image);

Joyce</description>
		<content:encoded><![CDATA[<p>Hi Gareth, Sorry it&#8217;s taken me so long to get back to you.  Can you be more specific regarding the problem you are having? The syntax is as follows:</p>
<p>$photo->doCenterCrop(final_width, final_height, path_to_directory_to_store_image);</p>
<p>Joyce</p>
]]></content:encoded>
	</item>
</channel>
</rss>

