<?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>Ezzatron &#187; internet</title>
	<atom:link href="http://ezzatron.com/tag/internet/feed/" rel="self" type="application/rss+xml" />
	<link>http://ezzatron.com</link>
	<description>Bringing together the fine arts of programming and death metal.</description>
	<lastBuildDate>Fri, 19 Nov 2010 06:37:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Creating web thumbnails with PHP Imagick</title>
		<link>http://ezzatron.com/2010/03/17/creating-web-thumbnails-with-php-imagick/</link>
		<comments>http://ezzatron.com/2010/03/17/creating-web-thumbnails-with-php-imagick/#comments</comments>
		<pubDate>Wed, 17 Mar 2010 00:13:25 +0000</pubDate>
		<dc:creator>Erin</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[aspect]]></category>
		<category><![CDATA[BMP]]></category>
		<category><![CDATA[CMYK]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[colour]]></category>
		<category><![CDATA[format]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[ICC]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[Imagick]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[JPEG]]></category>
		<category><![CDATA[JPG]]></category>
		<category><![CDATA[maintain]]></category>
		<category><![CDATA[PNG]]></category>
		<category><![CDATA[profile]]></category>
		<category><![CDATA[ratio]]></category>
		<category><![CDATA[resize]]></category>
		<category><![CDATA[RGB]]></category>
		<category><![CDATA[sRGB]]></category>
		<category><![CDATA[thumbnail]]></category>
		<category><![CDATA[thumbnailing]]></category>
		<category><![CDATA[TIF]]></category>
		<category><![CDATA[TIFF]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://ezzatron.com/?p=283</guid>
		<description><![CDATA[It may seem like a subject that has been done to death, but creating thumbnails from images can be a complex and frustrating task, especially when you&#8217;re faced with a wide variety of formats in your source images. The script below uses PHP&#8217;s Imagick extension to create a thumbnail from pretty much any source image. [...]]]></description>
			<content:encoded><![CDATA[<p>It may seem like a subject that has been done to death, but creating thumbnails from images can be a complex and frustrating task, especially when you&#8217;re faced with a wide variety of formats in your source images.</p>
<p>The script below uses PHP&#8217;s <a title="PHP: ImageMagick - Manual" href="http://php.net/manual/en/book.imagick.php">Imagick extension</a> to create a thumbnail from pretty much any source image. It can handle RGB &amp; CMYK images, TIFFs, PNGs, JPEGs, GIFs, BMPs and just about any other format in just about any size, and it can also handle images with embedded colour profiles (this is very helpful when converting images created in Adobe software).</p>
<p><span id="more-283"></span></p>
<p>You&#8217;ll firstly need to grab the standard <a title="sRGB profiles" href="http://www.color.org/srgbprofiles.xalter">sRGB colour profile</a> from the <a title="International Color Consortium" href="http://www.color.org/">International Color Consortium</a> (ICC) website. Place this somewhere accessible to your script and you&#8217;re ready to go.</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;"><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">// the location of your image</span><br />
<span style="color: #000088;">$imagePath</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/path/to/source_image'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// these are treated as maximums and aspect ratio is maintained</span><br />
<span style="color: #000088;">$thumbnailWidth</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$thumbnailHeight</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// path to the sRGB ICC profile</span><br />
<span style="color: #000088;">$srgbPath</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'/path/to/sRGB_v4_ICC_preference.icc'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// load the original image</span><br />
<span style="color: #000088;">$image</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Imagick<span style="color: #009900;">&#40;</span><span style="color: #000088;">$imagePath</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// get the original dimensions</span><br />
<span style="color: #000088;">$width</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getImageWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$height</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getImageHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// set colour profile</span><br />
<span style="color: #666666; font-style: italic;">// this step is necessary even though the profiles are stripped out in the next step to reduce file size</span><br />
<span style="color: #000088;">$srgb</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/file_get_contents"><span style="color: #990000;">file_get_contents</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$srgbPath</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">profileImage</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'icc'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$srgb</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// strip colour profiles</span><br />
<span style="color: #000088;">$image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">stripImage</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// set colorspace</span><br />
<span style="color: #000088;">$image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setImageColorspace</span><span style="color: #009900;">&#40;</span>Imagick<span style="color: #339933;">::</span><span style="color: #004000;">COLORSPACE_SRGB</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// determine which dimension to fit to</span><br />
<span style="color: #000088;">$fitWidth</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumbnailWidth</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$width</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&lt;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumbnailHeight</span> <span style="color: #339933;">/</span> <span style="color: #000088;">$height</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// create thumbnail</span><br />
<span style="color: #000088;">$image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">thumbnailImage</span><span style="color: #009900;">&#40;</span><br />
&nbsp; <span style="color: #000088;">$fitWidth</span> ? <span style="color: #000088;">$thumbnailWidth</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span><br />
&nbsp; <span style="color: #000088;">$fitWidth</span> ? <span style="color: #cc66cc;">0</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$thumbnailHeight</span><br />
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// generate a thumbnail filename</span><br />
<span style="color: #000088;">$imagePathParts</span> <span style="color: #339933;">=</span> <a href="http://www.php.net/pathinfo"><span style="color: #990000;">pathinfo</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$imagePath</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$thumbnailPath</span> <span style="color: #339933;">=</span><br />
&nbsp; <span style="color: #000088;">$imagePathParts</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'dirname'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #339933;">.</span><br />
&nbsp; <span style="color: #000088;">$imagePathParts</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'filename'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'_'</span><span style="color: #339933;">.</span><br />
&nbsp; <span style="color: #000088;">$thumbnailWidth</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'x'</span><span style="color: #339933;">.</span><span style="color: #000088;">$thumbnailHeight</span><span style="color: #339933;">.</span><br />
&nbsp; <span style="color: #0000ff;">'.jpg'</span><span style="color: #339933;">;</span><br />
<br />
<span style="color: #666666; font-style: italic;">// save thumbnail and free up memory</span><br />
<span style="color: #000088;">$image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">writeImage</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$thumbnailPath</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">clear</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #000088;">$image</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">destroy</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></div></div>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fezzatron.com%2F2010%2F03%2F17%2Fcreating-web-thumbnails-with-php-imagick%2F';
  addthis_title  = 'Creating+web+thumbnails+with+PHP+Imagick';
  addthis_pub    = 'ezzatron';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://ezzatron.com/2010/03/17/creating-web-thumbnails-with-php-imagick/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Help stop the Great Firewall of Oz!</title>
		<link>http://ezzatron.com/2008/12/15/help-stop-the-great-firewall-of-oz/</link>
		<comments>http://ezzatron.com/2008/12/15/help-stop-the-great-firewall-of-oz/#comments</comments>
		<pubDate>Sun, 14 Dec 2008 22:16:00 +0000</pubDate>
		<dc:creator>Erin</dc:creator>
				<category><![CDATA[IT]]></category>
		<category><![CDATA[censorship]]></category>
		<category><![CDATA[filter]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[internet]]></category>

		<guid isPermaLink="false">http://ezzatron.com/?p=63</guid>
		<description><![CDATA[This is just a quick post to try and rally a few signatures against the ridiculous mandatory internet filter proposed for Australia. There are so many reasons why this should not go ahead. I won&#8217;t go into detail here, but you should learn more if you don&#8217;t know what I&#8217;m on about. Try Horus Kol&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick post to try and rally a few signatures against the ridiculous <a title="Internet censorship in Australia - Wikipedia" href="http://en.wikipedia.org/wiki/Internet_censorship_in_Australia">mandatory internet filter proposed for Australia</a>.</p>
<p>There are so many reasons why this should not go ahead. I won&#8217;t go into detail here, but you <strong>should</strong> learn more if you don&#8217;t know what I&#8217;m on about. Try Horus Kol&#8217;s <a title="Great Firewall of Oz - Horus Kol" href="http://www.horuskol.co.uk/great-firewall-of-oz-20081202">article</a>, or <a title="No Clean Feed" href="http://nocleanfeed.com/">No Clean Feed</a> for some good information.</p>
<p>Please use this nifty form to show your support for the fight against mandatory internet censorship:</p>
<div><object width="300" height="250" data="http://www.getup.org.au/flash/widget.swf" type="application/x-shockwave-flash"><param name="quality" value="high" /><param name="src" value="http://www.getup.org.au/flash/widget.swf" /></object></div>
<p>In addition, there is another petition you can sign at <a title="top Australian Internet Censorship - TakingITGlobal" href="http://petitions.takingitglobal.org/oznetcensorship">TakingITGlobal</a>.</p>
<script type="text/javascript">
  addthis_url    = 'http%3A%2F%2Fezzatron.com%2F2008%2F12%2F15%2Fhelp-stop-the-great-firewall-of-oz%2F';
  addthis_title  = 'Help+stop+the+Great+Firewall+of+Oz%21';
  addthis_pub    = 'ezzatron';
</script><script type="text/javascript" src="http://s7.addthis.com/js/addthis_widget.php?v=12" ></script>
]]></content:encoded>
			<wfw:commentRss>http://ezzatron.com/2008/12/15/help-stop-the-great-firewall-of-oz/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

