<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://www.bytemycode.com/rssformat.xsl"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title>byteMyCode: Snippets for GD</title>
		<link>http://www.bytemycode.com</link>
		<description>Snippets for this tag.</description>
		<pubDate>Wed, 09 Jul 2008 03:22:21 +0000</pubDate>
		<copyright>1998-2008 </copyright>
		<language>en-us</language>
		<image>
		      <link>http://www.bytemycode.com</link>
		      <url>http://www.bytemycode.com/img/rss_title.gif</url>
		      <title>byteMyCode</title>
		</image>

	<item>
	<title>Simple Image Resize in GD</title>
	<link>http://www.bytemycode.com/snippets/snippet/624/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/624/comments/</comments>
	<pubDate>Tue, 06 Mar 2007 14:36:01 +0000</pubDate>
	<dc:creator>wlasson</dc:creator>
	<category>"image resize", GD, images, PHP, Resize</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/624/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Tue. Mar. 6th, 2007  2:36 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/624/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_beginner.gif" align="middle" class="icon" alt="Beginner" /> <a href="http://www.bytemycode.com/members/member/wlasson/" title="Beginner">wlasson</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/%22image+resize%22">"image resize"</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/GD">GD</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/images">images</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Resize">Resize</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/624/comments/">1 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 13
			<p>This is a simple function that resizes and image using the GD add on for PHP. <br />Just a disclaimer: I know its not perfect, but i figured i would post it because the only other one on here is way confusing to some new PHP developers. Hopefully this one will help you learn how to use GD, and then you can write a better one.</p>
		]]>
	</description>
</item><item>
	<title>Resize Image Function</title>
	<link>http://www.bytemycode.com/snippets/snippet/485/</link>
	<comments>http://www.bytemycode.com/snippets/snippet/485/comments/</comments>
	<pubDate>Mon, 23 Oct 2006 22:48:31 +0000</pubDate>
	<dc:creator>jdenton</dc:creator>
	<category>GD, gif, images, jpeg, PHP, png, Resize</category>
	<guid isPermaLink="false">http://www.bytemycode.com/snippets/snippet/485/</guid>
	<description>
		<![CDATA[

			<img src="http://www.bytemycode.com/img/icon_calendar.gif" align="middle" class="icon" alt="Date Submitted" /> Mon. Oct. 23rd, 2006  10:48 PM			<br />
			<img src="http://www.bytemycode.com/img/icon_revision.gif" align="middle" class="icon" alt="Revision" /> <a href="http://www.bytemycode.com/snippets/snippet/485/revisions/">1</a>
			<br />
			<img src="http://www.bytemycode.com/img/rank_helper.gif" align="middle" class="icon" alt="Helper" /> <a href="http://www.bytemycode.com/members/member/jdenton/" title="Helper">jdenton</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_tag.gif" align="middle" class="icon" alt="Tags" /> <a href="http://www.bytemycode.com/tags/tag/GD">GD</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/gif">gif</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/images">images</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/jpeg">jpeg</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/PHP">PHP</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/png">png</a>&nbsp;|&nbsp;<a href="http://www.bytemycode.com/tags/tag/Resize">Resize</a>			<br />
			<img src="http://www.bytemycode.com/img/icon_comments.gif" align="middle" class="icon" alt="Comments" /> <a href="http://www.bytemycode.com/snippets/snippet/485/comments/">1 comments</a>
			<br />
			<img src="http://www.bytemycode.com/img/icon_ranking.gif" align="middle" class="icon" alt="Ranking" /> 5
			<p>The resize_image function allows you to resize a GIF, JPEG or PNG file to any dimension you wish and put an optional black border around the image.  Here's an explanation of the arguements:<br /><br />$image_path:  The complete path to the image to be resized<br /><br />$max_width: Maximum width of the resized image. Leave 0 if you want to specify only the height and have the width auto-scale.<br /><br />$max_height: Maximum height of the resized image. Leave 0 if you want to specify only the width and have the height auto-scale.<br /><br />$file_prefix: This will prepend a string onto the resized image filename. If you want to create a thumbnail image and keep the original, set $file_prefix = 'thumb'.<br /><br />$dir:  Allows you to save the resized image to a sub directory under the $image_path directory. If you want to save thumbnail images to images/thumbs, set $dir = 'thumbs'.<br /><br />$border: boolean, 1 = border, 0 = no border<br /><br />$mime:  Image mime type. (image/jpeg, image/gif, image/png)</p>
		]]>
	</description>
</item>
	</channel>
</rss>