<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mcmlxxii &#187; apache</title>
	<atom:link href="http://mcmlxxii.co.uk/tag/apache/feed/" rel="self" type="application/rss+xml" />
	<link>http://mcmlxxii.co.uk</link>
	<description></description>
	<lastBuildDate>Tue, 13 Mar 2012 19:53:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>PHP class using Imagick &#8211; resize, reflect or drop shadow</title>
		<link>http://mcmlxxii.co.uk/2009/01/06/php-class-imagick-resize-reflect-drop-shadow/</link>
		<comments>http://mcmlxxii.co.uk/2009/01/06/php-class-imagick-resize-reflect-drop-shadow/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 15:19:05 +0000</pubDate>
		<dc:creator>mcmlxxii</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[imagick]]></category>
		<category><![CDATA[oop]]></category>
		<category><![CDATA[photo]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php5]]></category>
		<category><![CDATA[upload]]></category>

		<guid isPermaLink="false">http://mcmlxxii.co.uk/?p=124</guid>
		<description><![CDATA[I&#8217;ve been spending a bit of time getting to know PHP classes over the Christmas holiday, and I&#8217;ve written a couple to test out my knowledge. The first is an image uploading class, which checks for various problems with files prior to moving them to a destination directory. It checks: that the file actually exists [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://mcmlxxii.co.uk/wp-content/uploads/2009/01/3156767211_5f3b53513b.jpg"><img class="alignright size-medium wp-image-133" title="Imagick used to generate reflection" src="http://mcmlxxii.co.uk/wp-content/uploads/2009/01/3156767211_5f3b53513b-155x300.jpg" alt="Imagick used to generate reflection" width="140" height="270" /></a>I&#8217;ve been spending a bit of time getting to know PHP classes over the Christmas holiday, and I&#8217;ve written a couple to test out my knowledge.<br />
The first is an image uploading class, which checks for various problems with files prior to moving them to a destination directory. It checks:</p>
<ul>
<li>that the file actually exists</li>
<li>the size to ensure it doesn&#8217;t exceed a predetermined maximum</li>
<li>that the destination directory exists and is writable</li>
<li>that the file is actually a photo file</li>
<li>to see that the photo is in an accepted format (tif, jpg, gif, png)</li>
</ul>
<p>before moving the file. The next class gives various options for manipulating the image, resizing, rounding corners, adding a reflection etc. all using the Imagick class, which is installed with php5-imagick (available from the ubuntu repos and other reputable linux software emporiums!). The reflection and drop shadow parts of the class owe a great deal to Mikko Koppanen who provides some great Imagick examples and code snippets on <a href="http://valokuva.org/" target="_blank">his blog</a>. I&#8217;ve uploaded the classes, including an index file that can be used as an example in the absence of proper documentation!</p>
<p>I&#8217;ve uploaded a working version of the test files shown below as a demo to a website of mine: <a href="http://blaxhall.com/classes">try it here.</a></p>
<p><a href='http://mcmlxxii.co.uk/wp-content/uploads/2010/02/files.zip'>Available to dowload</a> as a zip archive including the four empty directories the example script needs to run. Any suggestions for improvement gladly received.</p>
]]></content:encoded>
			<wfw:commentRss>http://mcmlxxii.co.uk/2009/01/06/php-class-imagick-resize-reflect-drop-shadow/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

