<?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: trick of the week: autocropping</title>
	<atom:link href="http://verens.com/2006/02/12/trick-of-the-week-autocropping/feed/" rel="self" type="application/rss+xml" />
	<link>http://verens.com/2006/02/12/trick-of-the-week-autocropping/</link>
	<description>klog - Kae&#039;s Log</description>
	<lastBuildDate>Fri, 10 Feb 2012 21:49:24 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: klog &#187; return of the autocropper</title>
		<link>http://verens.com/2006/02/12/trick-of-the-week-autocropping/#comment-631</link>
		<dc:creator>klog &#187; return of the autocropper</dc:creator>
		<pubDate>Wed, 26 Sep 2007 08:40:49 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/archives/2006/02/12/trick-of-the-week-autocropping/#comment-631</guid>
		<description>[...] I remembered a little demo I announced almost two years ago and tried it in IE6 to find it did not [...]</description>
		<content:encoded><![CDATA[<p>[...] I remembered a little demo I announced almost two years ago and tried it in IE6 to find it did not [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markku Uttula</title>
		<link>http://verens.com/2006/02/12/trick-of-the-week-autocropping/#comment-630</link>
		<dc:creator>Markku Uttula</dc:creator>
		<pubDate>Tue, 14 Feb 2006 12:07:24 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/archives/2006/02/12/trick-of-the-week-autocropping/#comment-630</guid>
		<description>I must say that I&#039;m unfamiliar with the API that GD offers to PHP, but I believe there ain&#039;t no faster way to do what you&#039;re doing. However, we can always cheat :)

First of all, GD is internally highly optimized; currently what you&#039;re doing is reading just parts of the image (I believe it&#039;s because of the speed issue). However, using PHP to resample the image to a &quot;better&quot; size; ie. round(original_img_height / wanted_strip_height) using imagecopyresampled and changing it to grayscale (just interested in the lightness of the pixels? after all, that is what you&#039;re doing manually) using imagecopymerge with a suitable precreated grayscaleimage might speed up things. However, as I said, the method you&#039;ve chosen might just be the fastest method there is... I&#039;d need to do some testing to prove (or disprove) my theory on the effect these changes would have on the speed.</description>
		<content:encoded><![CDATA[<p>I must say that I&#8217;m unfamiliar with the API that GD offers to PHP, but I believe there ain&#8217;t no faster way to do what you&#8217;re doing. However, we can always cheat <img src='http://verens.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First of all, GD is internally highly optimized; currently what you&#8217;re doing is reading just parts of the image (I believe it&#8217;s because of the speed issue). However, using PHP to resample the image to a &#8220;better&#8221; size; ie. round(original_img_height / wanted_strip_height) using imagecopyresampled and changing it to grayscale (just interested in the lightness of the pixels? after all, that is what you&#8217;re doing manually) using imagecopymerge with a suitable precreated grayscaleimage might speed up things. However, as I said, the method you&#8217;ve chosen might just be the fastest method there is&#8230; I&#8217;d need to do some testing to prove (or disprove) my theory on the effect these changes would have on the speed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kae Verens</title>
		<link>http://verens.com/2006/02/12/trick-of-the-week-autocropping/#comment-629</link>
		<dc:creator>Kae Verens</dc:creator>
		<pubDate>Tue, 14 Feb 2006 10:47:28 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/archives/2006/02/12/trick-of-the-week-autocropping/#comment-629</guid>
		<description>Thanks, Markku. I had considered caching, of course, but in the interest of simplicity, left it out of this &quot;proof of concept&quot; - note as well that the script currently assumes the image is a PNG, where a more complete solution would load from generally any format. Also, the script assumes your float is on the left.

I would be interested to see a faster method to grab the needed colours. I am not proficient with graphical programming, so worked by basically choosing the simplest and clearest route, then seeing what functions PHP provided to match what I needed.</description>
		<content:encoded><![CDATA[<p>Thanks, Markku. I had considered caching, of course, but in the interest of simplicity, left it out of this &#8220;proof of concept&#8221; &#8211; note as well that the script currently assumes the image is a PNG, where a more complete solution would load from generally any format. Also, the script assumes your float is on the left.</p>
<p>I would be interested to see a faster method to grab the needed colours. I am not proficient with graphical programming, so worked by basically choosing the simplest and clearest route, then seeing what functions PHP provided to match what I needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markku Uttula</title>
		<link>http://verens.com/2006/02/12/trick-of-the-week-autocropping/#comment-628</link>
		<dc:creator>Markku Uttula</dc:creator>
		<pubDate>Tue, 14 Feb 2006 10:11:27 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/archives/2006/02/12/trick-of-the-week-autocropping/#comment-628</guid>
		<description>Oh yes, and the demo does work in IE, however it has some problems (IE apparently thinks that the slices&#039; Z-index is higher than that of the text&#039;s).</description>
		<content:encoded><![CDATA[<p>Oh yes, and the demo does work in IE, however it has some problems (IE apparently thinks that the slices&#8217; Z-index is higher than that of the text&#8217;s).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Markku Uttula</title>
		<link>http://verens.com/2006/02/12/trick-of-the-week-autocropping/#comment-627</link>
		<dc:creator>Markku Uttula</dc:creator>
		<pubDate>Tue, 14 Feb 2006 10:09:00 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/archives/2006/02/12/trick-of-the-week-autocropping/#comment-627</guid>
		<description>Once again, your solution is ingenious. However, I wouldn&#039;t recommend this method for sites with high traffic due to the weight it puts on the server hardware. It could be minimised by using some sort of cacheing of the responses. Of course, this is most likely obvious to you and anyone that&#039;s ever programmed graphics, but I feel like I must point out that get/setPixel-type of functions are *the* slowest methods of accessing image data and gd&#039;s imagecolorat (though highly optimised) is no different in this aspect.</description>
		<content:encoded><![CDATA[<p>Once again, your solution is ingenious. However, I wouldn&#8217;t recommend this method for sites with high traffic due to the weight it puts on the server hardware. It could be minimised by using some sort of cacheing of the responses. Of course, this is most likely obvious to you and anyone that&#8217;s ever programmed graphics, but I feel like I must point out that get/setPixel-type of functions are *the* slowest methods of accessing image data and gd&#8217;s imagecolorat (though highly optimised) is no different in this aspect.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

