<?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: pre-parsing HTML for incorrectly-sized images</title>
	<atom:link href="http://verens.com/2008/07/27/pre-parsing-html-for-incorrectly-sized-images/feed/" rel="self" type="application/rss+xml" />
	<link>http://verens.com/2008/07/27/pre-parsing-html-for-incorrectly-sized-images/</link>
	<description>klog - Kae&#039;s Log</description>
	<lastBuildDate>Mon, 21 May 2012 21:11:58 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
<xhtml:meta xmlns:xhtml="http://www.w3.org/1999/xhtml" name="robots" content="noindex" />
	<item>
		<title>By: klog &#187; Blog Archive &#187; php and jquery chp7: image manipulation</title>
		<link>http://verens.com/2008/07/27/pre-parsing-html-for-incorrectly-sized-images/#comment-1133</link>
		<dc:creator>klog &#187; Blog Archive &#187; php and jquery chp7: image manipulation</dc:creator>
		<pubDate>Sat, 18 Jul 2009 10:43:53 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/?p=474#comment-1133</guid>
		<description>[...] The idea is that when you upload an image, it&#8217;s usually not yet right to include in a website. People tend to upload massive photos (3000&#215;2000 or so) and resize it down using the &lt;img&gt; attributes, which is the wrong way to do it (see here for a solution to that particular problem). [...]</description>
		<content:encoded><![CDATA[<p>[...] The idea is that when you upload an image, it&#8217;s usually not yet right to include in a website. People tend to upload massive photos (3000&#215;2000 or so) and resize it down using the &lt;img&gt; attributes, which is the wrong way to do it (see here for a solution to that particular problem). [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: amos</title>
		<link>http://verens.com/2008/07/27/pre-parsing-html-for-incorrectly-sized-images/#comment-1132</link>
		<dc:creator>amos</dc:creator>
		<pubDate>Tue, 09 Sep 2008 19:54:54 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/?p=474#comment-1132</guid>
		<description>teaching the client to crop (and why it is important) is the best way to work this out.

and to make it even easier, there is nothing simpler then http://www.easycropper.com/ .

hope i could help!

Amos</description>
		<content:encoded><![CDATA[<p>teaching the client to crop (and why it is important) is the best way to work this out.</p>
<p>and to make it even easier, there is nothing simpler then <a href="http://www.easycropper.com/" rel="nofollow">http://www.easycropper.com/</a> .</p>
<p>hope i could help!</p>
<p>Amos</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kae Verens</title>
		<link>http://verens.com/2008/07/27/pre-parsing-html-for-incorrectly-sized-images/#comment-1131</link>
		<dc:creator>Kae Verens</dc:creator>
		<pubDate>Tue, 29 Jul 2008 20:48:38 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/?p=474#comment-1131</guid>
		<description>I should probably have explained my reasoning there. The use of an exec there was a calculated choice.

GD (and Imagick, the built-in version of ImageMagick) both &quot;suffer&quot; from the memory setting in /etc/php.ini. While it is a great and essential limitation for most cases, in this case, we know that the image manipulation will probably go over that limit, but also that it&#039;s a once-off problem. Programs run through exec(), however, are not counted when PHP&#039;s memory usage is calculated.

Also, it&#039;s much quicker to write a simple one-liner like I did above, than to go to the effort needed for GD or Imagick.

As far as I can see, there are no security flaws in the code I wrote - all values run through the exec() function are filtered beforehand (addslashes(), regexps).

The only real problem here is portability - the function requires a Linux server, and that the external ImageMagick program be installed. However, as a proof of concept, I think I can be allowed that flaw ;-)

Stevan, feel free to use it as you wish. Ryan, i know what you mean, and I really did think about the exec() function before I used it.</description>
		<content:encoded><![CDATA[<p>I should probably have explained my reasoning there. The use of an exec there was a calculated choice.</p>
<p>GD (and Imagick, the built-in version of ImageMagick) both &#8220;suffer&#8221; from the memory setting in /etc/php.ini. While it is a great and essential limitation for most cases, in this case, we know that the image manipulation will probably go over that limit, but also that it&#8217;s a once-off problem. Programs run through exec(), however, are not counted when PHP&#8217;s memory usage is calculated.</p>
<p>Also, it&#8217;s much quicker to write a simple one-liner like I did above, than to go to the effort needed for GD or Imagick.</p>
<p>As far as I can see, there are no security flaws in the code I wrote &#8211; all values run through the exec() function are filtered beforehand (addslashes(), regexps).</p>
<p>The only real problem here is portability &#8211; the function requires a Linux server, and that the external ImageMagick program be installed. However, as a proof of concept, I think I can be allowed that flaw <img src='http://verens.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Stevan, feel free to use it as you wish. Ryan, i know what you mean, and I really did think about the exec() function before I used it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: lifewithryan</title>
		<link>http://verens.com/2008/07/27/pre-parsing-html-for-incorrectly-sized-images/#comment-1130</link>
		<dc:creator>lifewithryan</dc:creator>
		<pubDate>Tue, 29 Jul 2008 19:41:07 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/?p=474#comment-1130</guid>
		<description>I agree, good ideas, but use GD instead....exec scares the bajeezus outta me.</description>
		<content:encoded><![CDATA[<p>I agree, good ideas, but use GD instead&#8230;.exec scares the bajeezus outta me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Stevan Goode</title>
		<link>http://verens.com/2008/07/27/pre-parsing-html-for-incorrectly-sized-images/#comment-1129</link>
		<dc:creator>Stevan Goode</dc:creator>
		<pubDate>Tue, 29 Jul 2008 18:22:40 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/?p=474#comment-1129</guid>
		<description>Hi,

This is a good solution to the problem, however the exec makes me cringe somewhat. Personally, I would use the GD library to do the resize, but that&#039;s just me.

Well done on a good routine :-) I think I might &#039;borrow&#039; it for my projects.

Thanks,

Steve</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>This is a good solution to the problem, however the exec makes me cringe somewhat. Personally, I would use the GD library to do the resize, but that&#8217;s just me.</p>
<p>Well done on a good routine <img src='http://verens.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  I think I might &#8216;borrow&#8217; it for my projects.</p>
<p>Thanks,</p>
<p>Steve</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kae Verens&#8217; Blog: pre-parsing HTML for incorrectly-sized images &#124; Development Blog With Code Updates : Developercast.com</title>
		<link>http://verens.com/2008/07/27/pre-parsing-html-for-incorrectly-sized-images/#comment-1128</link>
		<dc:creator>Kae Verens&#8217; Blog: pre-parsing HTML for incorrectly-sized images &#124; Development Blog With Code Updates : Developercast.com</dc:creator>
		<pubDate>Tue, 29 Jul 2008 17:40:29 +0000</pubDate>
		<guid isPermaLink="false">http://verens.com/?p=474#comment-1128</guid>
		<description>[...] Verens has a recent blog post that looks at a method for helping to protect users from themselves when working with images - a [...]</description>
		<content:encoded><![CDATA[<p>[...] Verens has a recent blog post that looks at a method for helping to protect users from themselves when working with images &#8211; a [...]</p>
]]></content:encoded>
	</item>
</channel>
</rss>

