<?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: PHP ICO to PNG conversion</title>
	<atom:link href="http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/</link>
	<description>Tech Talk, Catholic Commentary, and American Activism</description>
	<lastBuildDate>Mon, 21 Mar 2011 01:50:48 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Edward de Leau</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-14883</link>
		<dc:creator>Edward de Leau</dc:creator>
		<pubDate>Mon, 21 Mar 2011 01:50:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119#comment-14883</guid>
		<description>XOR ing the icon sometimes goes wrong on line 298: $bits .= str_pad(decbin(ord($this-&gt;formats[$index][&#039;data&#039;][$offset + $i])), 8, &#039;0&#039;, STR_PAD_LEFT);

e.g. with icon found here: http://www.slatch.com/ as favicon</description>
		<content:encoded><![CDATA[<p>XOR ing the icon sometimes goes wrong on line 298: $bits .= str_pad(decbin(ord($this->formats[$index]['data'][$offset + $i])), 8, &#8216;0&#8242;, STR_PAD_LEFT);</p>
<p>e.g. with icon found here: <a href="http://www.slatch.com/" rel="nofollow">http://www.slatch.com/</a> as favicon</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: edward de leau</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-14839</link>
		<dc:creator>edward de leau</dc:creator>
		<pubDate>Thu, 10 Mar 2011 15:12:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119#comment-14839</guid>
		<description>I sometimes get the following notice on some icons:

Notice: Uninitialized string offset: 64 in class.ico.php on line 296

Im using the class in my WordPress plugin so it loads thousands of different ico&#039;s on some I get this error.</description>
		<content:encoded><![CDATA[<p>I sometimes get the following notice on some icons:</p>
<p>Notice: Uninitialized string offset: 64 in class.ico.php on line 296</p>
<p>Im using the class in my WordPress plugin so it loads thousands of different ico&#8217;s on some I get this error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: admin</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-14827</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 19 Nov 2010 08:09:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119#comment-14827</guid>
		<description>imagepng($png, &quot;filename.png&quot;);
should work...

If not, I would check:
- that you have the GD library installed and available on your system
- that it&#039;s not a file permissions issue (php not allowed to write to the directory you&#039;re working in)
- that the original .ico you&#039;re converting isn&#039;t blank or malformed

When all else fails, try some troubleshooting. See if imagegif($png, &quot;filename.gif&quot;); works, etc.</description>
		<content:encoded><![CDATA[<p>imagepng($png, &#8220;filename.png&#8221;);<br />
should work&#8230;</p>
<p>If not, I would check:<br />
- that you have the GD library installed and available on your system<br />
- that it&#8217;s not a file permissions issue (php not allowed to write to the directory you&#8217;re working in)<br />
- that the original .ico you&#8217;re converting isn&#8217;t blank or malformed</p>
<p>When all else fails, try some troubleshooting. See if imagegif($png, &#8220;filename.gif&#8221;); works, etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Flashsnake</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-14826</link>
		<dc:creator>Flashsnake</dc:creator>
		<pubDate>Mon, 08 Nov 2010 01:56:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119#comment-14826</guid>
		<description>What should I do if I need to save the png image as a file? I tried to use:

imagepng($png, &quot;sample.png&quot;); 

But the image turns out to be blank.

Thanks,</description>
		<content:encoded><![CDATA[<p>What should I do if I need to save the png image as a file? I tried to use:</p>
<p>imagepng($png, &#8220;sample.png&#8221;); </p>
<p>But the image turns out to be blank.</p>
<p>Thanks,</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tony</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-1448</link>
		<dc:creator>Tony</dc:creator>
		<pubDate>Wed, 28 Apr 2010 08:57:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119#comment-1448</guid>
		<description>wanna see something cool?

GetIconInfo($index);
	$icons[$index][&#039;width&#039;] = $icon[&#039;Width&#039;];
	$icons[$index][&#039;bitcount&#039;] = $icon[&#039;BitCount&#039;];
}
// sort by width, then bitcount (ascending). you can change the priority if you like by switching them around above
asort($icons);
// get the key of the last icon (highest quality) in the sorted list
$best = end(array_keys($icons));
// now make a png
if(!($png=$ico-&gt;GetIcon($best))) die(&quot;Could not load ICO.&quot;);
else {
	header(&quot;Content-Type: image/png&quot;);
	imagepng($png);
}
// win!
?&gt;

with a bit more effort, i use this to generate image preview tooltips in apache&#039;s autoindex [=</description>
		<content:encoded><![CDATA[<p>wanna see something cool?</p>
<p>GetIconInfo($index);<br />
	$icons[$index]['width'] = $icon['Width'];<br />
	$icons[$index]['bitcount'] = $icon['BitCount'];<br />
}<br />
// sort by width, then bitcount (ascending). you can change the priority if you like by switching them around above<br />
asort($icons);<br />
// get the key of the last icon (highest quality) in the sorted list<br />
$best = end(array_keys($icons));<br />
// now make a png<br />
if(!($png=$ico->GetIcon($best))) die(&#8220;Could not load ICO.&#8221;);<br />
else {<br />
	header(&#8220;Content-Type: image/png&#8221;);<br />
	imagepng($png);<br />
}<br />
// win!<br />
?></p>
<p>with a bit more effort, i use this to generate image preview tooltips in apache&#8217;s autoindex [=</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vahan</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-1123</link>
		<dc:creator>Vahan</dc:creator>
		<pubDate>Sun, 14 Feb 2010 06:29:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119#comment-1123</guid>
		<description>wordpress broke my loop! anyway it should be:
for($index = 0; $index LESSTHAN $ico-&gt;TotalIcons(); $index++){</description>
		<content:encoded><![CDATA[<p>wordpress broke my loop! anyway it should be:<br />
for($index = 0; $index LESSTHAN $ico->TotalIcons(); $index++){</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vahan</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-1122</link>
		<dc:creator>Vahan</dc:creator>
		<pubDate>Sun, 14 Feb 2010 06:25:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119#comment-1122</guid>
		<description>wanna see something cool?

&lt;?php
error_reporting(0);
require &#039;class.ico.php&#039;;
// load the .ico
$ico = new Ico(&#039;favicon.ico&#039;);
// now we&#039;re going to find the highest quality icon! first we need to know about each icon&#039;s image quality...
for($index = 0; $index TotalIcons(); $index++){
	$icon = $ico-&gt;GetIconInfo($index);
	$icons[$index][&#039;width&#039;] = $icon[&#039;Width&#039;];
	$icons[$index][&#039;bitcount&#039;] = $icon[&#039;BitCount&#039;];
}
// sort by width, then bitcount (ascending). you can change the priority if you like by switching them around above
asort($icons);
// get the key of the last icon (highest quality) in the sorted list
$best = end(array_keys($icons));
// now make a png
if(!($png=$ico-&gt;GetIcon($best))) die(&quot;Could not load ICO.&quot;);
else {
	header(&quot;Content-Type: image/png&quot;);
	imagepng($png);
}
// win!
?&gt;

with a bit more effort, i use this to generate image preview tooltips in apache&#039;s autoindex [=</description>
		<content:encoded><![CDATA[<p>wanna see something cool?</p>
<p>< ?php<br />
error_reporting(0);<br />
require 'class.ico.php';<br />
// load the .ico<br />
$ico = new Ico('favicon.ico');<br />
// now we're going to find the highest quality icon! first we need to know about each icon's image quality...<br />
for($index = 0; $index TotalIcons(); $index++){<br />
	$icon = $ico->GetIconInfo($index);<br />
	$icons[$index]['width'] = $icon['Width'];<br />
	$icons[$index]['bitcount'] = $icon['BitCount'];<br />
}<br />
// sort by width, then bitcount (ascending). you can change the priority if you like by switching them around above<br />
asort($icons);<br />
// get the key of the last icon (highest quality) in the sorted list<br />
$best = end(array_keys($icons));<br />
// now make a png<br />
if(!($png=$ico->GetIcon($best))) die(&#8220;Could not load ICO.&#8221;);<br />
else {<br />
	header(&#8220;Content-Type: image/png&#8221;);<br />
	imagepng($png);<br />
}<br />
// win!<br />
?></p>
<p>with a bit more effort, i use this to generate image preview tooltips in apache&#8217;s autoindex [=</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: KonstantinMiller</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-286</link>
		<dc:creator>KonstantinMiller</dc:creator>
		<pubDate>Mon, 06 Jul 2009 22:32:19 +0000</pubDate>
		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119#comment-286</guid>
		<description>I have been looking looking around for this kind of information. Will you post some more in future? I&#039;ll be grateful if you will.</description>
		<content:encoded><![CDATA[<p>I have been looking looking around for this kind of information. Will you post some more in future? I&#8217;ll be grateful if you will.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: CrisBetewsky</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-285</link>
		<dc:creator>CrisBetewsky</dc:creator>
		<pubDate>Mon, 06 Jul 2009 20:29:12 +0000</pubDate>
		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119#comment-285</guid>
		<description>I&#039;m glad that after surfing the web for uch a long time I have found out this information. I&#039;m really lucky.</description>
		<content:encoded><![CDATA[<p>I&#8217;m glad that after surfing the web for uch a long time I have found out this information. I&#8217;m really lucky.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: GarykPatton</title>
		<link>http://www.tom-reitz.com/2009/02/17/php-ico-to-png-conversion/comment-page-1/#comment-208</link>
		<dc:creator>GarykPatton</dc:creator>
		<pubDate>Tue, 16 Jun 2009 13:42:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.tom-reitz.com/?p=119#comment-208</guid>
		<description>Hello, can you please post some more information on this topic? I would like to read more.</description>
		<content:encoded><![CDATA[<p>Hello, can you please post some more information on this topic? I would like to read more.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

