<?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>elxsy &#187; imagick on windows</title>
	<atom:link href="http://www.elxsy.com/tag/imagick-on-windows/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elxsy.com</link>
	<description>where humanity wins the fight against machines</description>
	<lastBuildDate>Mon, 15 Aug 2011 10:08:39 +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>Installing ImageMagick on Windows and Using with PHP &#8211; Imagick</title>
		<link>http://www.elxsy.com/2009/07/installing-imagemagick-on-windows-and-using-with-php-imagick/</link>
		<comments>http://www.elxsy.com/2009/07/installing-imagemagick-on-windows-and-using-with-php-imagick/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 16:20:35 +0000</pubDate>
		<dc:creator>cenOTapH</dc:creator>
				<category><![CDATA[ImageMagick]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[dll]]></category>
		<category><![CDATA[exe]]></category>
		<category><![CDATA[imagick]]></category>
		<category><![CDATA[imagick dll]]></category>
		<category><![CDATA[imagick installation]]></category>
		<category><![CDATA[imagick on windows]]></category>
		<category><![CDATA[install]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[php 5.2]]></category>
		<category><![CDATA[php convert image]]></category>
		<category><![CDATA[php image manipulation]]></category>
		<category><![CDATA[php imagick dll]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[windows xp]]></category>

		<guid isPermaLink="false">http://www.elxsy.com/?p=265</guid>
		<description><![CDATA[As most of your know ImageMagick is like the photoshop on your console demand. Best with their explanation. ImageMagick® is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of formats (over 100) including DPX, EXR, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, [...]


No related posts.]]></description>
			<content:encoded><![CDATA[<p>As most of your know <a href="http://imagemagick.org/script/index.php">ImageMagick </a>is like the photoshop on your console demand. Best with their explanation.</p>
<blockquote><p>ImageMagick<sup><a href="http://tarr.uspto.gov/servlet/tarr?regser=serial&amp;entry=78333969">®</a></sup> is a software suite to create, edit, and compose bitmap images. It can read, convert and write images in a variety of <a href="http://imagemagick.org/script/formats.php">formats</a> (over 100) including <a href="http://imagemagick.org/script/motion-picture.php">DPX</a>, <a href="http://imagemagick.org/script/high-dynamic-range.php">EXR</a>, GIF, JPEG, JPEG-2000, PDF, PhotoCD, PNG, Postscript, SVG, and TIFF. Use ImageMagick to translate, flip, mirror, rotate, scale, shear and transform images, adjust image colors, apply various special effects, or draw text, lines, polygons, ellipses and Bézier curves.</p></blockquote>
<p>It is very powerful and supports all platforms with tons of different languages and implementations. Because my hosting solutions did not suppot it (many of them dont do as well) I always used awesome GD library to process images on my projects. Well now my hosting does support and I am going to use it so I needed to install it to my development environment which is windows. I am going to install and use Imagick also because using IM from native PHP is much more faster than using it from console via exec.</p>
<p>Well first of all ImageMagick on windows with PHP is a really pain in the ass, if you have the commitment and time go for it otherwise use it from console. Here are the steps and todo's to install for <strong>PHP 5.2.x</strong>, ( I dont know if it works with PHP 5.3.x or below, you will need to test for yourself. I am a happy camper for now ).</p>
<h3><span style="color: #ff6600;">UPDATE</span></h3>
<p>Just to make things clear, all the PHP dll files (librarires) are 32 bit, so if your system is 64 bit and you will still need to download and operate 32 bit ImageMagick, Apache, etc.</p>
<h3><span id="more-265"></span>1 Download ImageMagick</h3>
<p>Go to <a href="http://imagemagick.org/script/binary-releases.php#windows">http://imagemagick.org/script/binary-releases.php#windows</a> to download the latest version, which is <strong>ImageMagick-6.5.4-2-Q16-windows-dll.exe</strong></p>
<p>Now the beauty, static versions are suppose to work with every platform but they act really funny so you should download a dynamic version. If you system/pc supports go for 16 bit Q16. The difference is explained on the link very well.</p>
<p>Now in my case, the latest version did not work so I had to go through old versions and <strong>ImageMagick-6.4.2-7-Q16-windows-dll</strong> version worked like charm for me. My system is <strong>Windows XP SP2, 32 Bit, Intel Centrino 1.76GHZ.</strong> You can download the older versions from <a href="http://image_magick.veidrodis.com/image_magick/binaries/">here</a>.</p>
<p>I suggest you to download and try the latest one, complete all steps, if it doesnt work try with a lower version and so on.</p>
<h3>2 Install ImageMagick</h3>
<p>Install the IM on a path like <code>C:\imagemagick\</code> with no spaces and simple location. Do not go for c:\program files\etc</p>
<p><span style="color: #ff0000;">Do not forget</span> to click on the "<strong>Add to system path</strong>" checkbox. You can ignore the rest of the checkboxes</p>
<h3>3 Testing the Installation</h3>
<p>Open the command prompt (Run-&gt;"CMD"-&gt;ENTER) and type in <strong>convert</strong> and press enter. You should see the help parameters of convert. If so go to <strong>step 4.</strong></p>
<p>if it says its failed or unknown function or type in a parameter to convert ( which is a default function in Windows XP to convert HDD from FAT32 to NTFS or vice varsa ) you need to add path to environment by yourself.</p>
<p>My Computer -&gt; Right Click -&gt; Properties -&gt; Advanced (Tab) -&gt; Environment Variables (at the bottom) -&gt; System Variables (Section) -&gt; Scroll to Find "<strong>Path</strong>" -&gt; Select it and click <strong>Edit</strong> -&gt; Add your installation directory to there.</p>
<h3>4 Downloading the php_Imagick.dll</h3>
<p>Again the version problem, well if you are using <strong>PHP 5.2.x</strong> this is <a href="http://valokuva.org/outside-blog-content/imagick-windows-builds/080709/">where you will get your</a> dll.</p>
<p>dyn = dynamic, st = static, q16 = 16 bit, q8= 8 bit. This should match your downloaded version of course. If you downloaded q16 dynamic library, your file will be <a href="http://valokuva.org/outside-blog-content/imagick-windows-builds/080709/php_imagick_dyn-Q16.dll">php_imagick_dyn-Q16.dll</a></p>
<p>If you are using <strong>PHP 5.3.x</strong>, <a href="http://valokuva.org/outside-blog-content/imagick-windows-builds/php53/">this is your location</a> to download.</p>
<h3>5 Find and Place the dll in your extension folder</h3>
<p>Rename the downloaded dll to <strong>php_imagick.dll</strong> for easy usage and place it under your extension folder. It is usually <code>php/ext/</code>. Go to <strong>Step 6</strong>.</p>
<p>If it is not, then you can find it in your php.ini file with the extension_dir param.<br />
<code>; Directory in which the loadable extensions (modules) reside.<br />
extension_dir = "Something something"</code></p>
<h3>6 Edit PHP.ini</h3>
<p>Uncomment if it exists or add if it doesnt exist this line<br />
<code>extension=php_imagick.dll</code></p>
<h3>7 Restart</h3>
<p>This is the important part, I spent good half an hour trying to make it work.. grrrr.. You need to restart your PC to libraries take effect.</p>
<p>If you do not restart and start your apache you will see an error like. So please do restart your PC.</p>
<blockquote><p>Unable to find CORE_RL_Wand.dll something something.</p></blockquote>
<h3>8 Start Apache and check</h3>
<p>Start your apache, and check with the <strong>phpinfo()</strong> , if you see imagick library and its values thats it you are set. go to <strong>step 9</strong>.</p>
<p>If not you have picked up the wrong dll file for PHP. Browse through the directory and try another dlls, if they dont work try to lower your ImageMagick installation version. Dont give up, it will work.</p>
<h3>9 Test with some code</h3>
<p>Put a nice big picture named <strong>a.jpg</strong> along side with your<strong> test.php</strong> script, run the test and check the directory to see <strong>a_thumnail.jpg</strong>. Here is the script, simple and fast <img src='http://www.elxsy.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush:php">&lt;?
$im = new imagick( 'a.jpg' );
// resize by 200 width and keep the ratio
$im-&gt;thumbnailImage( 200, 0);
// write to disk
$im-&gt;writeImage( 'a_thumbnail.jpg' );
?&gt;</pre>
<h3>10 Manual, Learning and Playing Around</h3>
<p>To use it from php all you need is  <a href="http://uk3.php.net/imagick">PHP functions and manual</a> including some examples as well.</p>
<p>If you want to go further and mess around <a href="http://www.imagemagick.org/Usage/">here is the</a> command line ( exec() ) parameters, manuals and examples</p>
<h2>Finally</h2>
<p>So this is it, I hope you get it to work at the first trial now and drop a comment if you have any useful information or experience any error, we will try to help you out.</p>


<p>No related posts.</p>]]></content:encoded>
			<wfw:commentRss>http://www.elxsy.com/2009/07/installing-imagemagick-on-windows-and-using-with-php-imagick/feed/</wfw:commentRss>
		<slash:comments>65</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
