<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Image manipulation with PHP &#038; the GD library, Part 1</title>
	<link>http://phpit.net/article/image-manipulation-php-gd-part1/</link>
	<description>PHPit has dozens of PHP articles, codesnippets and FAQ's.</description>
	<pubDate>Fri, 01 Aug 2008 04:10:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>

	<item>
		<title>by: Strandburglar</title>
		<link>http://phpit.net/article/image-manipulation-php-gd-part1/#comment-11691</link>
		<pubDate>Tue, 22 Aug 2006 01:31:25 +0000</pubDate>
		<guid>http://phpit.net/article/image-manipulation-php-gd-part1/#comment-11691</guid>
					<description>If the image files you are trying to open had been uploaded by a user, the file type would be in $_FILES['imagefile']['type'] where imagefile is the name of the form element which uploaded the image. This way you could use a function more like the one you showed which checked the extension. For example
switch($_FILES['imagefile']['type']){
case 'image/jpeg':
$im = @imagecreatefromjpeg($file);
break;
case 'image/gif':
//etc. etc.</description>
		<content:encoded><![CDATA[<p>If the image files you are trying to open had been uploaded by a user, the file type would be in $_FILES[&#8217;imagefile&#8217;][&#8217;type&#8217;] where imagefile is the name of the form element which uploaded the image. This way you could use a function more like the one you showed which checked the extension. For example<br />
switch($_FILES[&#8217;imagefile&#8217;][&#8217;type&#8217;]){<br />
case &#8216;image/jpeg&#8217;:<br />
$im = @imagecreatefromjpeg($file);<br />
break;<br />
case &#8216;image/gif&#8217;:<br />
//etc. etc.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: flashape</title>
		<link>http://phpit.net/article/image-manipulation-php-gd-part1/#comment-11505</link>
		<pubDate>Sat, 19 Aug 2006 00:43:47 +0000</pubDate>
		<guid>http://phpit.net/article/image-manipulation-php-gd-part1/#comment-11505</guid>
					<description>there is a better solution to your 'hit-or-miss' method when you talk about a file having the wrong extension.  the php method getImageSize() returns array of information about an image, which is [width, height, imageType], where image type would be 'JPG', 'GIF', 'PNG', etc.  

http://us3.php.net/getimagesize</description>
		<content:encoded><![CDATA[<p>there is a better solution to your &#8216;hit-or-miss&#8217; method when you talk about a file having the wrong extension.  the php method getImageSize() returns array of information about an image, which is [width, height, imageType], where image type would be &#8216;JPG&#8217;, &#8216;GIF&#8217;, &#8216;PNG&#8217;, etc.  </p>
<p><a href='http://us3.php.net/getimagesize' rel='nofollow'>http://us3.php.net/getimagesize</a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Max The IT pro</title>
		<link>http://phpit.net/article/image-manipulation-php-gd-part1/#comment-11491</link>
		<pubDate>Fri, 18 Aug 2006 19:31:50 +0000</pubDate>
		<guid>http://phpit.net/article/image-manipulation-php-gd-part1/#comment-11491</guid>
					<description>Dude, this is a great article as I soon plan to get cracking on PHP for some upcoming web projects. Thank you for taking the time to write this. It was "delicious." :-)</description>
		<content:encoded><![CDATA[<p>Dude, this is a great article as I soon plan to get cracking on PHP for some upcoming web projects. Thank you for taking the time to write this. It was &#8220;delicious.&#8221; :-)
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
