<?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: Image Crop Position in&#160;WordPress</title>
	<atom:link href="http://bradt.ca/blog/image-crop-position-in-wordpress/feed/" rel="self" type="application/rss+xml" />
	<link>http://bradt.ca/blog/image-crop-position-in-wordpress/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=image-crop-position-in-wordpress</link>
	<description>Independent web developer, web designer, and entrepreneur living in Halifax, Canada.</description>
	<lastBuildDate>Thu, 16 May 2013 20:50:36 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: kReEsTaL</title>
		<link>http://bradt.ca/blog/image-crop-position-in-wordpress/#comment-38489</link>
		<dc:creator>kReEsTaL</dc:creator>
		<pubDate>Sat, 09 Mar 2013 17:48:29 +0000</pubDate>
		<guid isPermaLink="false">http://bradt.ca/?p=9767#comment-38489</guid>
		<description><![CDATA[Hi!

Just to reply to &lt;strong&gt;Simon&lt;/strong&gt;, since I had the same question and found the solution : &quot;is it possible to update thumbnail’s options with this ? Or, as I understand, it’s only for new custom image sizes ?&quot;

In fact you can use Brad&#039;s &lt;code&gt;bt_add_image_size&lt;/code&gt; to create a new size, which will contain the exact same size parameters as your default media settings.

During the thumbnail creation, WordPress will automatically replace the old, middle-cropped thumbs by the new, top-cropped ones.

Example : in my Medias settings, the medium size is set to 280x280. Normally you don&#039;t have to add a new size for this since you can set it up directly in the Dashboard.

However, Brad&#039;s function won&#039;t re-crop the default thumbnail, medium and large image sizes you set up in the Dashboard.

That&#039;s why, in order to overwrite the default image sizes WordPress generates, I added the following line to my functions.php file:

&lt;code&gt;bt_add_image_size(&#039;medium-thumb&#039;, 280, 280, array( &#039;center&#039;, &#039;top&#039; ));&lt;/code&gt;

Since I want all my medium thumbnails to be 280x280, I simply mimic these settings in &lt;i&gt;a new image size&lt;/i&gt;, which will simply overwrite the default 280x280 medium thumbnail generated by WordPress with Brad&#039;s nicely cropped version.

Of course you can edit the name of this new image size (I&#039;m not sure you should name it &quot;medium&quot;, &quot;thumbnail&quot; nor &quot;large&quot; since they belong to WordPress&#039;s default namespace, pick a genuine name because you don&#039;t want to mess with WordPress&#039;s defaults!), the width, the height, and the crop attributes (it&#039;s the same parameters as in CSS background-position, just like Brad explained in his post).

Hope this helps :-)

Thanks a lot, Brad! Too bad WordPress 3.5.1 is out and your patch isn&#039;t part of the core yet.]]></description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Just to reply to <strong>Simon</strong>, since I had the same question and found the solution : &#8220;is it possible to update thumbnail’s options with this ? Or, as I understand, it’s only for new custom image sizes ?&#8221;</p>
<p>In fact you can use Brad&#8217;s <code>bt_add_image_size</code> to create a new size, which will contain the exact same size parameters as your default media settings.</p>
<p>During the thumbnail creation, WordPress will automatically replace the old, middle-cropped thumbs by the new, top-cropped ones.</p>
<p>Example : in my Medias settings, the medium size is set to 280&#215;280. Normally you don&#8217;t have to add a new size for this since you can set it up directly in the Dashboard.</p>
<p>However, Brad&#8217;s function won&#8217;t re-crop the default thumbnail, medium and large image sizes you set up in the Dashboard.</p>
<p>That&#8217;s why, in order to overwrite the default image sizes WordPress generates, I added the following line to my functions.php file:</p>
<p><code>bt_add_image_size('medium-thumb', 280, 280, array( 'center', 'top' ));</code></p>
<p>Since I want all my medium thumbnails to be 280&#215;280, I simply mimic these settings in <i>a new image size</i>, which will simply overwrite the default 280&#215;280 medium thumbnail generated by WordPress with Brad&#8217;s nicely cropped version.</p>
<p>Of course you can edit the name of this new image size (I&#8217;m not sure you should name it &#8220;medium&#8221;, &#8220;thumbnail&#8221; nor &#8220;large&#8221; since they belong to WordPress&#8217;s default namespace, pick a genuine name because you don&#8217;t want to mess with WordPress&#8217;s defaults!), the width, the height, and the crop attributes (it&#8217;s the same parameters as in CSS background-position, just like Brad explained in his post).</p>
<p>Hope this helps <img src='http://bradt.ca/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Thanks a lot, Brad! Too bad WordPress 3.5.1 is out and your patch isn&#8217;t part of the core yet.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamshed</title>
		<link>http://bradt.ca/blog/image-crop-position-in-wordpress/#comment-38484</link>
		<dc:creator>Jamshed</dc:creator>
		<pubDate>Sat, 09 Mar 2013 09:32:02 +0000</pubDate>
		<guid isPermaLink="false">http://bradt.ca/?p=9767#comment-38484</guid>
		<description><![CDATA[this is really helpful for i want something like that crop your images as you want.....

Many Many Thanks......

:)]]></description>
		<content:encoded><![CDATA[<p>this is really helpful for i want something like that crop your images as you want&#8230;..</p>
<p>Many Many Thanks&#8230;&#8230;</p>
<p> <img src='http://bradt.ca/wp/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NR</title>
		<link>http://bradt.ca/blog/image-crop-position-in-wordpress/#comment-38372</link>
		<dc:creator>NR</dc:creator>
		<pubDate>Sun, 24 Feb 2013 16:35:39 +0000</pubDate>
		<guid isPermaLink="false">http://bradt.ca/?p=9767#comment-38372</guid>
		<description><![CDATA[Such a frustrating problem! I have the same question as Dashaluna. Hope to read your reply! Thanks.]]></description>
		<content:encoded><![CDATA[<p>Such a frustrating problem! I have the same question as Dashaluna. Hope to read your reply! Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dashaluna</title>
		<link>http://bradt.ca/blog/image-crop-position-in-wordpress/#comment-38341</link>
		<dc:creator>dashaluna</dc:creator>
		<pubDate>Wed, 20 Feb 2013 16:50:37 +0000</pubDate>
		<guid isPermaLink="false">http://bradt.ca/?p=9767#comment-38341</guid>
		<description><![CDATA[Hello Brad,

Thanks a lot for the code!

I&#039;ve got a question however, I hope you would be able to help me out. I had 6 custom image sizes declared with add_image_size which already had all images generated for them. After finding your post I&#039;ve changed all my declarations to bt_add_image_size for custom sizes.

I have then used &lt;a href=&quot;http://wordpress.org/extend/plugins/ajax-thumbnail-rebuild/&quot; rel=&quot;nofollow&quot;&gt;AJAX Thumbnail Rebuild&lt;/a&gt; plugin to rebuild the images of those custom sizes with the new custom crop location. However, that didn&#039;t seem to work.

I&#039;ve also used the plugin that you suggested &lt;a href=&quot;http://wordpress.org/extend/plugins/regenerate-thumbnails/&quot; rel=&quot;nofollow&quot;&gt;Regenerate Thumbnails&lt;/a&gt; However, it outputs an error after 10 successful images.

How can I make sure that the images of custom size that already had been regenerate are regenerated again using your crop position code? I would hugely appreciate your help!

Many thanks,
Dasha]]></description>
		<content:encoded><![CDATA[<p>Hello Brad,</p>
<p>Thanks a lot for the code!</p>
<p>I&#8217;ve got a question however, I hope you would be able to help me out. I had 6 custom image sizes declared with add_image_size which already had all images generated for them. After finding your post I&#8217;ve changed all my declarations to bt_add_image_size for custom sizes.</p>
<p>I have then used <a href="http://wordpress.org/extend/plugins/ajax-thumbnail-rebuild/" rel="nofollow">AJAX Thumbnail Rebuild</a> plugin to rebuild the images of those custom sizes with the new custom crop location. However, that didn&#8217;t seem to work.</p>
<p>I&#8217;ve also used the plugin that you suggested <a href="http://wordpress.org/extend/plugins/regenerate-thumbnails/" rel="nofollow">Regenerate Thumbnails</a> However, it outputs an error after 10 successful images.</p>
<p>How can I make sure that the images of custom size that already had been regenerate are regenerated again using your crop position code? I would hugely appreciate your help!</p>
<p>Many thanks,<br />
Dasha</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bastian Haustein</title>
		<link>http://bradt.ca/blog/image-crop-position-in-wordpress/#comment-38338</link>
		<dc:creator>Bastian Haustein</dc:creator>
		<pubDate>Tue, 19 Feb 2013 15:33:38 +0000</pubDate>
		<guid isPermaLink="false">http://bradt.ca/?p=9767#comment-38338</guid>
		<description><![CDATA[Finally it did not make its way into the release?

I would strongly appreciate to have that extra functionality as I did implement it several times in a kind of a dirty hack in customer projects.

Kind regards!

Bastian]]></description>
		<content:encoded><![CDATA[<p>Finally it did not make its way into the release?</p>
<p>I would strongly appreciate to have that extra functionality as I did implement it several times in a kind of a dirty hack in customer projects.</p>
<p>Kind regards!</p>
<p>Bastian</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://bradt.ca/blog/image-crop-position-in-wordpress/#comment-37554</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Thu, 06 Dec 2012 03:04:19 +0000</pubDate>
		<guid isPermaLink="false">http://bradt.ca/?p=9767#comment-37554</guid>
		<description><![CDATA[Thanks man! Worked great.]]></description>
		<content:encoded><![CDATA[<p>Thanks man! Worked great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthew</title>
		<link>http://bradt.ca/blog/image-crop-position-in-wordpress/#comment-37031</link>
		<dc:creator>Matthew</dc:creator>
		<pubDate>Tue, 30 Oct 2012 05:53:59 +0000</pubDate>
		<guid isPermaLink="false">http://bradt.ca/?p=9767#comment-37031</guid>
		<description><![CDATA[I ..... love you.  This worked with minimal fuss (and I&#039;m so accustomed to fuss).  Thanks for sharing your brains, man.  Helped me out a ton!]]></description>
		<content:encoded><![CDATA[<p>I &#8230;.. love you.  This worked with minimal fuss (and I&#8217;m so accustomed to fuss).  Thanks for sharing your brains, man.  Helped me out a ton!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J. Schneider</title>
		<link>http://bradt.ca/blog/image-crop-position-in-wordpress/#comment-37029</link>
		<dc:creator>J. Schneider</dc:creator>
		<pubDate>Tue, 30 Oct 2012 02:16:23 +0000</pubDate>
		<guid isPermaLink="false">http://bradt.ca/?p=9767#comment-37029</guid>
		<description><![CDATA[Thank you Brad,

stumbled upon your post by accident and am very happy I found it. Helped me with a cutomers website!
I will definetly check out your post more often. keep up the good work. 

Cheers, Jennifer]]></description>
		<content:encoded><![CDATA[<p>Thank you Brad,</p>
<p>stumbled upon your post by accident and am very happy I found it. Helped me with a cutomers website!<br />
I will definetly check out your post more often. keep up the good work. </p>
<p>Cheers, Jennifer</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: SoN9ne</title>
		<link>http://bradt.ca/blog/image-crop-position-in-wordpress/#comment-36935</link>
		<dc:creator>SoN9ne</dc:creator>
		<pubDate>Tue, 02 Oct 2012 20:08:39 +0000</pubDate>
		<guid isPermaLink="false">http://bradt.ca/?p=9767#comment-36935</guid>
		<description><![CDATA[I have a question before I test this out. 

I see: 
&lt;code&gt;if ( !is_null($dest_path) and $_dest_path = realpath($dest_path) )&lt;/code&gt;

should that be:
&lt;code&gt;if ( !is_null($dest_path) and $_dest_path == realpath($dest_path) )&lt;/code&gt;

Or are you purposely defining the &lt;code&gt;$_dest_path&lt;/code&gt;?

Thanks!]]></description>
		<content:encoded><![CDATA[<p>I have a question before I test this out. </p>
<p>I see:<br />
<code>if ( !is_null($dest_path) and $_dest_path = realpath($dest_path) )</code></p>
<p>should that be:<br />
<code>if ( !is_null($dest_path) and $_dest_path == realpath($dest_path) )</code></p>
<p>Or are you purposely defining the <code>$_dest_path</code>?</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dev</title>
		<link>http://bradt.ca/blog/image-crop-position-in-wordpress/#comment-36925</link>
		<dc:creator>dev</dc:creator>
		<pubDate>Thu, 27 Sep 2012 11:01:36 +0000</pubDate>
		<guid isPermaLink="false">http://bradt.ca/?p=9767#comment-36925</guid>
		<description><![CDATA[Thanks Brad !
Solved my issue I have been struggling for long time.]]></description>
		<content:encoded><![CDATA[<p>Thanks Brad !<br />
Solved my issue I have been struggling for long time.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
