<?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: Smart Image Resizing while Preserving Transparency With PHP and GD Library</title>
	<atom:link href="http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/feed/" rel="self" type="application/rss+xml" />
	<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/</link>
	<description>by Maxim Chernyak</description>
	<lastBuildDate>Thu, 04 Mar 2010 06:30:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: pat</title>
		<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/comment-page-2/#comment-1030</link>
		<dc:creator>pat</dc:creator>
		<pubDate>Tue, 23 Feb 2010 14:15:27 +0000</pubDate>
		<guid isPermaLink="false">#comment-1030</guid>
		<description>&lt;p&gt;Struggled with inconsistent transparency-results on a resized PNG for two hours...
Solved my problem in 5min after i found your routine/example...
THANKS!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<div style=""><p></p><p>Struggled with inconsistent transparency-results on a resized PNG for two hours&#8230;
Solved my problem in 5min after i found your routine/example&#8230;
THANKS!</p></div>]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/comment-page-2/#comment-629</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Sat, 06 Feb 2010 18:44:14 +0000</pubDate>
		<guid isPermaLink="false">#comment-629</guid>
		<description>&lt;p&gt;I was using the thumbnail resize solution from Sitepoint&#039;s PHP Anthology (2nd edition), and I was able to integrate your transparency handling code into it easily.  Thanks!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<div style=""><p></p><p>I was using the thumbnail resize solution from Sitepoint&#8217;s PHP Anthology (2nd edition), and I was able to integrate your transparency handling code into it easily.  Thanks!</p></div>]]></content:encoded>
	</item>
	<item>
		<title>By: hakunin</title>
		<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/comment-page-2/#comment-239</link>
		<dc:creator>hakunin</dc:creator>
		<pubDate>Wed, 20 Jan 2010 09:19:42 +0000</pubDate>
		<guid isPermaLink="false">#comment-239</guid>
		<description>&lt;p&gt;The parameter named &lt;code inline=&quot;true&quot;&gt;$output&lt;/code&gt; accepts any arbitrary filesystem paths.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>The parameter named <code class="codecolorer text default"><span class="text">$output</span></code> accepts any arbitrary filesystem paths.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Marvin S.</title>
		<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/comment-page-2/#comment-150</link>
		<dc:creator>Marvin S.</dc:creator>
		<pubDate>Sat, 09 Jan 2010 18:35:51 +0000</pubDate>
		<guid isPermaLink="false">#comment-150</guid>
		<description>&lt;p&gt;Hey you, sorry, but i&#039;ve one question.
If I want to save the resized image into an thumb folder like /thumbs/, where do I have to define the output path of the saved image?&lt;/p&gt;

&lt;p&gt;Marvin&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey you, sorry, but i&#8217;ve one question.
If I want to save the resized image into an thumb folder like /thumbs/, where do I have to define the output path of the saved image?</p>

<p>Marvin</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Tom </title>
		<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/comment-page-2/#comment-148</link>
		<dc:creator>Tom </dc:creator>
		<pubDate>Wed, 04 Nov 2009 18:25:10 +0000</pubDate>
		<guid isPermaLink="false">#comment-148</guid>
		<description>&lt;p&gt;My own re-size function was not properly handling transparency. I was able to integrate your transparency handling section into my function in just a couple minutes and have tested both gif and png.&lt;/p&gt;

&lt;p&gt;Works absolutely perfect!&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>My own re-size function was not properly handling transparency. I was able to integrate your transparency handling section into my function in just a couple minutes and have tested both gif and png.</p>

<p>Works absolutely perfect!</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/comment-page-2/#comment-202</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Wed, 28 Oct 2009 21:21:13 +0000</pubDate>
		<guid isPermaLink="false">#comment-202</guid>
		<description>&lt;p&gt;a second option for dealing with GIFs is to add&lt;/p&gt;

&lt;p&gt;imagetruecolortopalette($image_resized, true, imagecolorstotal($image) );&lt;/p&gt;

&lt;p&gt;after&lt;/p&gt;

&lt;p&gt;imagecolortransparent( $image_resized, $trnprt_indx );&lt;/p&gt;

&lt;p&gt;this will convert the truecolor image to a palette with the same number of colors as the original image.&lt;/p&gt;

&lt;p&gt;FYI: GIFs are images based on the 256 color palette, imagecreatetruecolor() creates an image based on 1.6 million colors (or so).&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>a second option for dealing with GIFs is to add</p>

<p>imagetruecolortopalette($image_resized, true, imagecolorstotal($image) );</p>

<p>after</p>

<p>imagecolortransparent( $image_resized, $trnprt_indx );</p>

<p>this will convert the truecolor image to a palette with the same number of colors as the original image.</p>

<p>FYI: GIFs are images based on the 256 color palette, imagecreatetruecolor() creates an image based on 1.6 million colors (or so).</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/comment-page-2/#comment-144</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Wed, 28 Oct 2009 20:03:19 +0000</pubDate>
		<guid isPermaLink="false">#comment-144</guid>
		<description>&lt;p&gt;Thank you for providing some great code...
However, after trying to resize some transparent gifs for the past few days I finally noticed from php.net that imagecreatetruecolor() does not work with gifs.&lt;/p&gt;

&lt;p&gt;so I added
&lt;code&gt;
if ( $info[2] == IMAGETYPE_GIF )
    $image_resized = imagecreate( $final_width, $final_height );
else
    $image_resized = imagecreatetruecolor( $final_width, $final_height );
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;If someone is able to get imagecreatetruecolor() to work on gifs let me know, but I keep getting a filled in background.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thank you for providing some great code&#8230;
However, after trying to resize some transparent gifs for the past few days I finally noticed from php.net that imagecreatetruecolor() does not work with gifs.</p>

<p>so I added

<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">if ( $info[2] == IMAGETYPE_GIF )<br />
&nbsp; &nbsp; $image_resized = imagecreate( $final_width, $final_height );<br />
else<br />
&nbsp; &nbsp; $image_resized = imagecreatetruecolor( $final_width, $final_height );</div></div>

</p>

<p>If someone is able to get imagecreatetruecolor() to work on gifs let me know, but I keep getting a filled in background.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Sanjeev</title>
		<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/comment-page-1/#comment-132</link>
		<dc:creator>Sanjeev</dc:creator>
		<pubDate>Thu, 08 Oct 2009 07:09:10 +0000</pubDate>
		<guid isPermaLink="false">#comment-132</guid>
		<description>&lt;p&gt;it really works great as i tried for png.
But for gif image it dint gave the output as i expected. May be the original image 360x211 in dimension, while i was resizing to 300x300(with aspect ratio maintained) it gave kind of zigzag colored image&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>it really works great as i tried for png.
But for gif image it dint gave the output as i expected. May be the original image 360&#215;211 in dimension, while i was resizing to 300&#215;300(with aspect ratio maintained) it gave kind of zigzag colored image</p>]]></content:encoded>
	</item>
	<item>
		<title>By: XRumerTest</title>
		<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/comment-page-1/#comment-116</link>
		<dc:creator>XRumerTest</dc:creator>
		<pubDate>Thu, 17 Sep 2009 23:46:29 +0000</pubDate>
		<guid isPermaLink="false">#comment-116</guid>
		<description>&lt;p&gt;Hello. And Bye.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hello. And Bye.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://mediumexposure.com/smart-image-resizing-while-preserving-transparency-php-and-gd-library/comment-page-1/#comment-133</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 17 Sep 2009 06:37:10 +0000</pubDate>
		<guid isPermaLink="false">#comment-133</guid>
		<description>&lt;p&gt;thanks 4 the lesson and .. you figured the stuff about transparency transfer ; that are not pointed out in the majority of php png manipulation methods.&lt;/p&gt;

&lt;p&gt;P.S. png transparency thumbnail alpha blend png resize resizing tool function&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<div style=""><p></p><p>thanks 4 the lesson and .. you figured the stuff about transparency transfer ; that are not pointed out in the majority of php png manipulation methods.</p>

<p>P.S. png transparency thumbnail alpha blend png resize resizing tool function</p></div>]]></content:encoded>
	</item>
</channel>
</rss>
