<?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>Jonathan Wijaya Loe&#039;s blog &#187; imagemagick</title>
	<atom:link href="http://blog.jloe.net/tag/imagemagick/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jloe.net</link>
	<description>A blog about technology blogging, tips and tricks, troubleshooting, and step by step tutorial with specialties in Microsoft .NET, C#, Zend, and PHP. Also includes wonderful and inspiring stories and jokes.</description>
	<lastBuildDate>Mon, 02 May 2011 00:05:10 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Image Manipulation in PHP</title>
		<link>http://blog.jloe.net/2009/06/22/image-manipulation-in-php/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=image-manipulation-in-php</link>
		<comments>http://blog.jloe.net/2009/06/22/image-manipulation-in-php/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 08:49:17 +0000</pubDate>
		<dc:creator>Jonathan Loe</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[gd]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[image manipulation]]></category>
		<category><![CDATA[image processing]]></category>
		<category><![CDATA[imagemagick]]></category>
		<category><![CDATA[imagick]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php_gd2]]></category>
		<category><![CDATA[php_imagick]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[wampserver]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://blog.jloe.net/?p=665</guid>
		<description><![CDATA[Sometimes there is a need to do simple image manipulation for certain web projects. Take for example a popular site called Flickr. Flickr is an image hosting site that allows online community to store pictures for others to view. And for some cases some uploaders may have big image files and hence a site like [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes there is a need to do simple image manipulation for certain web projects. Take for example a popular site called <a title="Click to go to Flickr" href="http://www.flickr.com/" target="_blank">Flickr</a>. Flickr is an image hosting site that allows online community to store pictures for others to view. And for some cases some uploaders may have big image files and hence a site like Flickr definitely needs some image processing to reduce the actual image into a smaller dimension, hence smaller file size, to allow quick view before actually downloading the actual size.</p>
<p>I&#8217;ve been working with <a title="Click to check about Zend Framework" href="http://framework.zend.com/" target="_blank">Zend Framework</a> quite sometime for web projects. I found it&#8217;s quite interesting to find that Zend Framework does not have any class to perform image manipulation even though a proposal for Zend_Image had been submitted to Zend community as a wrapper of existing PHP interfaces: <a title="Click to read more about GD." href="http://www.boutell.com/gd/" target="_blank">GD</a> and <a title="Click here to read about ImageMagick" href="http://www.imagemagick.org/" target="_blank">ImageMagick</a> but unfortunately <a title="Zend_Image proposal" href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Image+Proposal+-+Davey+Shafik" target="_blank">the proposal</a> was not considered.</p>
<p><!--adsense#az-edeal-->And for your information, GD which stands for &#8216;Gif Draw&#8217; is a standard PHP installation, unlike ImageMagick. If you wish to utilize these libraries, you need to have php extensions called php_gd2 and php_imagick respectively installed and enabled on the web server.</p>
<p>The noticeable difference between GD and ImageMagick is that GD simply does not support image format like <a title="Click to check more about TIFF" href="http://en.wikipedia.org/wiki/Tagged_Image_File_Format" target="_blank">TIFF</a> (Tagged Image File Format). If TIFF is not your issue then go for GD. And if you wish to make your development easier, you may be interested to use <a title="Click to download Thumbnail class" href="http://www.ajaxray.com/blog/2008/09/12/image-manipulation-in-zend-framework-with-php-thumbnailer-class-v20/" target="_blank">Thumbnail class</a> by our fellow developer. But if you&#8217;re looking into ImageMagick I&#8217;m going to show you the steps (from <a title="Click here to see the original post." href="http://sg.php.net/manual/en/imagick.setup.php" target="_blank">another site</a>) on how to install ImageMagick on your Windows web server as Windows installation is a bit tricky since &#8220;pecl install imagick&#8221; does NOT work properly.</p>
<ol>
<li>Download and install ImageMagick software from <a href="http://www.imagemagick.org/script/binary-releases.php#windows" target="_blank">http://www.imagemagick.org/script/binary-releases.php#windows</a>.</li>
<li>Download pecl-5.2-dev.zip (choose the version relevant to your PHP) from <a href="http://snaps.php.net/win32/" target="_blank">http://snaps.php.net/win32/</a></li>
<li>Copy php_imagick.dll from the archive you&#8217;ve downloaded to your PHP extension folder.</li>
<li>Add the following line to php.ini (in the extensions section):<br />
extension=php_imagick.dll</p>
<p>or on <a href="http://www.wampserver.com/en/" target="_blank" title="Click to go to WampServer official site">WampServer</a> click WampServer icon on taskbar, go to PHP &gt; php.ini and add the above entry.</li>
<li>Restart your server.</li>
<li>Try this example script below to verify your installation.
<pre name="code" class="php">header('Content-type: image/tif');

$image = new Imagick('example.tif');
// Create thumbnail for the specified image file.
$image-&gt;thumbnailImage(100, 0);

echo $image;</pre>
<p>The script should display the image thumbnail with a maximum width of 100 pixels.</li>
</ol>
<p>If you find the above steps are difficult to follow you may want to download php_imagick.dll <a title="Click to download" href="../wp-content/uploads/2009/06/php_imagick.zip">here</a> and start from step 3. And if you need help with these libraries, check the manual pages for <a title="Click to see the manual page." href="http://us3.php.net/manual/en/ref.image.php" target="_blank">GD</a> and <a title="Click to see the manual page." href="http://us3.php.net/manual/en/book.imagick.php" target="_blank">ImageMagick</a>.</p>
<p>Lastly if you find this post helpful, kindly leave your rating below to indicate that this post is really useful and at the same time let others know about this post. And if your wish to let other communities know about this post kindly click the sociable icons below. Thanks!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.jloe.net/2009/06/22/image-manipulation-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

