<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Image Manipulation using PHP and ImageMagicK</title>
	<atom:link href="http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/</link>
	<description>A coders playground.</description>
	<lastBuildDate>Wed, 01 Feb 2012 10:04:12 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
	<item>
		<title>By: Quora</title>
		<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/comment-page-1/#comment-95370</link>
		<dc:creator>Quora</dc:creator>
		<pubDate>Fri, 07 Jan 2011 06:20:10 +0000</pubDate>
		<guid isPermaLink="false">http://nodstrum.com/2007/02/06/imagemagick_manipulation/#comment-95370</guid>
		<description>&lt;strong&gt; How do I handle &quot;Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 14240 bytes) in /path/test.php on line 94&quot; when trying to execute imagecreatefromjpeg() on a 3.7MB JPEG file?...&lt;/strong&gt;

Increasing your memory limit as described elsewhere in this thread fixes the immediate problem. If you are manipulating large volumes of images, you may also consider spawning external programs such as ImageMagick or its slightly more stable and perfor...</description>
		<content:encoded><![CDATA[<p><strong> How do I handle &#8220;Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 14240 bytes) in /path/test.php on line 94&#8243; when trying to execute imagecreatefromjpeg() on a 3.7MB JPEG file?&#8230;</strong></p>
<p>Increasing your memory limit as described elsewhere in this thread fixes the immediate problem. If you are manipulating large volumes of images, you may also consider spawning external programs such as ImageMagick or its slightly more stable and perfor&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tech</title>
		<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/comment-page-1/#comment-73890</link>
		<dc:creator>tech</dc:creator>
		<pubDate>Sun, 26 Sep 2010 10:28:47 +0000</pubDate>
		<guid isPermaLink="false">http://nodstrum.com/2007/02/06/imagemagick_manipulation/#comment-73890</guid>
		<description>a good simple for a right tutorial well made thank you</description>
		<content:encoded><![CDATA[<p>a good simple for a right tutorial well made thank you</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matthias Krells</title>
		<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/comment-page-1/#comment-72818</link>
		<dc:creator>Matthias Krells</dc:creator>
		<pubDate>Sat, 18 Sep 2010 22:23:22 +0000</pubDate>
		<guid isPermaLink="false">http://nodstrum.com/2007/02/06/imagemagick_manipulation/#comment-72818</guid>
		<description>Und Schwupps in den RSS-Feed ?bernommen.. Viele Gr??e aus Berlin Matthias</description>
		<content:encoded><![CDATA[<p>Und Schwupps in den RSS-Feed ?bernommen.. Viele Gr??e aus Berlin Matthias</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Derleth</title>
		<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/comment-page-1/#comment-12756</link>
		<dc:creator>Derleth</dc:creator>
		<pubDate>Wed, 14 Jan 2009 15:07:36 +0000</pubDate>
		<guid isPermaLink="false">http://nodstrum.com/2007/02/06/imagemagick_manipulation/#comment-12756</guid>
		<description>thanks ^^</description>
		<content:encoded><![CDATA[<p>thanks ^^</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wodka</title>
		<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/comment-page-1/#comment-9016</link>
		<dc:creator>wodka</dc:creator>
		<pubDate>Mon, 10 Nov 2008 13:02:44 +0000</pubDate>
		<guid isPermaLink="false">http://nodstrum.com/2007/02/06/imagemagick_manipulation/#comment-9016</guid>
		<description>Wow! Thank you very much. I had exactly the same problem. Your solution saved me a lot of time :)</description>
		<content:encoded><![CDATA[<p>Wow! Thank you very much. I had exactly the same problem. Your solution saved me a lot of time <img src='http://www.nodstrum.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shafique</title>
		<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/comment-page-1/#comment-8877</link>
		<dc:creator>shafique</dc:creator>
		<pubDate>Sat, 08 Nov 2008 22:40:38 +0000</pubDate>
		<guid isPermaLink="false">http://nodstrum.com/2007/02/06/imagemagick_manipulation/#comment-8877</guid>
		<description>SOLVED!!!!!!

See the following link:
http://www.daniweb.com/forums/thread116143.html

And here&#039;s my solution (I uninstalled IM and reinstalled it into my home directory, that&#039;s why the paths are different from what I listed before. But this has nothing to do with what the problem was. I also changed the user from www to www2 - I added the www2 user and made a change in the httpd.conf file - but again this was part of troubleshooting and had nothing to do with the problem):

Code:
putenv(&quot;MAGICK_HOME=&quot; .$_ENV[&quot;MAGICK_HOME&quot;]. &quot;/Users/shafique/ImageMagick-6.4.5/&quot;);
exec(&#039;echo $MAGICK_HOME&#039;,$array);
putenv(&quot;PATH=&quot; .$_ENV[&quot;PATH&quot;]. &quot;/Users/shafique/ImageMagick-6.4.5/bin&quot;);
exec(&#039;echo $PATH&#039;,$array);
putenv(&quot;DYLD_LIBRARY_PATH=&quot; .$_ENV[&quot;DYLD_LIBRARY_PATH&quot;]. &quot;/Users/shafique/ImageMagick-6.4.5/lib&quot;);
exec(&#039;echo $DYLD_LIBRARY_PATH&#039;,$array);
echo &quot;&quot;.print_r($array).&quot;&quot;;
exec(&#039;/Users/shafique/ImageMagick-6.4.5/bin/convert /Users/www2/IMG_0041.JPG /Users/www2/41.png 2&gt;&amp;1&#039;, $array);


So the problem was that my environment variables would not stay set they way that I had set them after installing IM; I have to set them each time I run the php code, as above. Note that simply using:

Code:
exec( &#039;export $DYLD_LIBRARY_PATH=&quot;/Users/shafique/ImageMagick-6.4.5/lib&quot; &#039;,$array);


(as per the IM installation instructions) will NOT work; the environment variable will NOT stay set this way (at least on my Leopard 10.5 MacBook Pro). Note also it necessary that both the input and output files be in a directory that is accessible to all (I did chmod a+rw /Users/www2).

I hope this helps others!</description>
		<content:encoded><![CDATA[<p>SOLVED!!!!!!</p>
<p>See the following link:<br />
<a href="http://www.daniweb.com/forums/thread116143.html" rel="nofollow">http://www.daniweb.com/forums/thread116143.html</a></p>
<p>And here&#8217;s my solution (I uninstalled IM and reinstalled it into my home directory, that&#8217;s why the paths are different from what I listed before. But this has nothing to do with what the problem was. I also changed the user from www to www2 &#8211; I added the www2 user and made a change in the httpd.conf file &#8211; but again this was part of troubleshooting and had nothing to do with the problem):</p>
<p>Code:<br />
putenv(&#8220;MAGICK_HOME=&#8221; .$_ENV["MAGICK_HOME"]. &#8220;/Users/shafique/ImageMagick-6.4.5/&#8221;);<br />
exec(&#8216;echo $MAGICK_HOME&#8217;,$array);<br />
putenv(&#8220;PATH=&#8221; .$_ENV["PATH"]. &#8220;/Users/shafique/ImageMagick-6.4.5/bin&#8221;);<br />
exec(&#8216;echo $PATH&#8217;,$array);<br />
putenv(&#8220;DYLD_LIBRARY_PATH=&#8221; .$_ENV["DYLD_LIBRARY_PATH"]. &#8220;/Users/shafique/ImageMagick-6.4.5/lib&#8221;);<br />
exec(&#8216;echo $DYLD_LIBRARY_PATH&#8217;,$array);<br />
echo &#8220;&#8221;.print_r($array).&#8221;";<br />
exec(&#8216;/Users/shafique/ImageMagick-6.4.5/bin/convert /Users/www2/IMG_0041.JPG /Users/www2/41.png 2&gt;&amp;1&#8242;, $array);</p>
<p>So the problem was that my environment variables would not stay set they way that I had set them after installing IM; I have to set them each time I run the php code, as above. Note that simply using:</p>
<p>Code:<br />
exec( &#8216;export $DYLD_LIBRARY_PATH=&#8221;/Users/shafique/ImageMagick-6.4.5/lib&#8221; &#8216;,$array);</p>
<p>(as per the IM installation instructions) will NOT work; the environment variable will NOT stay set this way (at least on my Leopard 10.5 MacBook Pro). Note also it necessary that both the input and output files be in a directory that is accessible to all (I did chmod a+rw /Users/www2).</p>
<p>I hope this helps others!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shafique</title>
		<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/comment-page-1/#comment-8869</link>
		<dc:creator>shafique</dc:creator>
		<pubDate>Sat, 08 Nov 2008 19:53:47 +0000</pubDate>
		<guid isPermaLink="false">http://nodstrum.com/2007/02/06/imagemagick_manipulation/#comment-8869</guid>
		<description>Hello HW,

Thanks for the suggestion about the access rights. The PHP user operates as &quot;_www&quot;. Changing permissions recursively on the IM directory to give all users rwx permissions, which I did, should have taken care of any permissions issues. I ran some tests using php script to see what kind of errors were being returned, and here&#039;s what I came up with:

Here&#039;s the testing code:

$array=array();
echo &quot;&quot;;
exec(&quot;/Applications/ImageMagick-6.4.4/bin/convert IMG_0041.JPG 41.png 2&gt;&amp;1&quot;, $array);
echo &quot;&quot;.print_r($array).&quot;&quot;;
echo &quot;&quot;; 

and here&#039;s the error that the above script generated:

Array
(
    [0] =&gt; dyld: Library not loaded: /ImageMagick-6.4.4/lib/libMagickCore.1.dylib
    [1] =&gt;   Referenced from: /Applications/ImageMagick-6.4.4/bin/convert
    [2] =&gt;   Reason: image not found
)

What&#039;s odd is that running the following command from the command line in a terminal window:

/Applications/ImageMagick-6.4.4/bin/convert IMG_0041.JPG 41.png 2&gt;&amp;1

works just fine. I&#039;m thinking to focus on the first error:

[0] =&gt; dyld: Library not loaded: /ImageMagick-6.4.4/lib/libMagickCore.1.dylib

It seems that as a terminal user the library loads, but as &quot;_www&quot; it does not. Since the permissions are fine, maybe the paths need to be changed for the &quot;_www&quot; Are path settings different for different users? Your thoughts?</description>
		<content:encoded><![CDATA[<p>Hello HW,</p>
<p>Thanks for the suggestion about the access rights. The PHP user operates as &#8220;_www&#8221;. Changing permissions recursively on the IM directory to give all users rwx permissions, which I did, should have taken care of any permissions issues. I ran some tests using php script to see what kind of errors were being returned, and here&#8217;s what I came up with:</p>
<p>Here&#8217;s the testing code:</p>
<p>$array=array();<br />
echo &#8220;&#8221;;<br />
exec(&#8220;/Applications/ImageMagick-6.4.4/bin/convert IMG_0041.JPG 41.png 2&gt;&amp;1&#8243;, $array);<br />
echo &#8220;&#8221;.print_r($array).&#8221;";<br />
echo &#8220;&#8221;; </p>
<p>and here&#8217;s the error that the above script generated:</p>
<p>Array<br />
(<br />
    [0] =&gt; dyld: Library not loaded: /ImageMagick-6.4.4/lib/libMagickCore.1.dylib<br />
    [1] =&gt;   Referenced from: /Applications/ImageMagick-6.4.4/bin/convert<br />
    [2] =&gt;   Reason: image not found<br />
)</p>
<p>What&#8217;s odd is that running the following command from the command line in a terminal window:</p>
<p>/Applications/ImageMagick-6.4.4/bin/convert IMG_0041.JPG 41.png 2&gt;&amp;1</p>
<p>works just fine. I&#8217;m thinking to focus on the first error:</p>
<p>[0] =&gt; dyld: Library not loaded: /ImageMagick-6.4.4/lib/libMagickCore.1.dylib</p>
<p>It seems that as a terminal user the library loads, but as &#8220;_www&#8221; it does not. Since the permissions are fine, maybe the paths need to be changed for the &#8220;_www&#8221; Are path settings different for different users? Your thoughts?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Human Wannabe</title>
		<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/comment-page-1/#comment-8719</link>
		<dc:creator>Human Wannabe</dc:creator>
		<pubDate>Thu, 06 Nov 2008 17:26:30 +0000</pubDate>
		<guid isPermaLink="false">http://nodstrum.com/2007/02/06/imagemagick_manipulation/#comment-8719</guid>
		<description>shafique: you may want to check the access rights &amp; permisions you have for PHP vs terminal user</description>
		<content:encoded><![CDATA[<p>shafique: you may want to check the access rights &amp; permisions you have for PHP vs terminal user</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: shafique</title>
		<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/comment-page-1/#comment-7937</link>
		<dc:creator>shafique</dc:creator>
		<pubDate>Fri, 24 Oct 2008 22:32:18 +0000</pubDate>
		<guid isPermaLink="false">http://nodstrum.com/2007/02/06/imagemagick_manipulation/#comment-7937</guid>
		<description>Hello, I&#039;m also having problems executing &quot;convert&quot; using PHP.

First the path was wrong, and the system command gave me a return value of 127. Then I fixed the path to the convert command (/Applications/ImageMagick-6.4.4/bin/convert), and I fixed the paths to the input and output filenames. Here is the code I&#039;m using:

&lt;?php
$resizefile = &quot;/Applications/ImageMagick-6.4.4/bin/convert /Users/shafiquejamal/outsideofwebdir/uploads/IMG_0041.JPG /Users/shafiquejamal/outsideofwebdir/uploads/41.png&quot;;

echo $resizefile;
$last_line = system($resizefile , $retval);

// Printing additional info
echo &#039;

Last line of the output: &#039; . $last_line . &#039;
Return value: &#039; . $retval;
?&gt;

The return value is 5, when I execute this; it does not convert the file. BUT When I copy and past the resize command exactly (without quotes) into the terminal window, it works just fine - it converts the file. It just doesn&#039;t work from php (i.e. the php script executed from the brower does not do anything). I&#039;m running MAC OS X Leopard 10.5.5 on a MacBook Pro (Intel), and using ImageMagick-6.4.4 I&#039;ve changed permissions on the source and target folders using chmod a+rw {paths}, and checked that everyone can read and write to those directories.</description>
		<content:encoded><![CDATA[<p>Hello, I&#8217;m also having problems executing &#8220;convert&#8221; using PHP.</p>
<p>First the path was wrong, and the system command gave me a return value of 127. Then I fixed the path to the convert command (/Applications/ImageMagick-6.4.4/bin/convert), and I fixed the paths to the input and output filenames. Here is the code I&#8217;m using:</p>
<p>&lt;?php<br />
$resizefile = &#8220;/Applications/ImageMagick-6.4.4/bin/convert /Users/shafiquejamal/outsideofwebdir/uploads/IMG_0041.JPG /Users/shafiquejamal/outsideofwebdir/uploads/41.png&#8221;;</p>
<p>echo $resizefile;<br />
$last_line = system($resizefile , $retval);</p>
<p>// Printing additional info<br />
echo &#8216;</p>
<p>Last line of the output: &#8216; . $last_line . &#8216;<br />
Return value: &#8216; . $retval;<br />
?&gt;</p>
<p>The return value is 5, when I execute this; it does not convert the file. BUT When I copy and past the resize command exactly (without quotes) into the terminal window, it works just fine &#8211; it converts the file. It just doesn&#8217;t work from php (i.e. the php script executed from the brower does not do anything). I&#8217;m running MAC OS X Leopard 10.5.5 on a MacBook Pro (Intel), and using ImageMagick-6.4.4 I&#8217;ve changed permissions on the source and target folders using chmod a+rw {paths}, and checked that everyone can read and write to those directories.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Andre</title>
		<link>http://www.nodstrum.com/2007/02/06/imagemagick_manipulation/comment-page-1/#comment-1686</link>
		<dc:creator>Andre</dc:creator>
		<pubDate>Thu, 31 Jul 2008 09:40:37 +0000</pubDate>
		<guid isPermaLink="false">http://nodstrum.com/2007/02/06/imagemagick_manipulation/#comment-1686</guid>
		<description>works like a charm. Found another tutorial on the imagemagick website that shows how to generate multiple images and put them together as a prgressive gif making look like a slide show. I&#039;ll try and find the link to it again and post it here</description>
		<content:encoded><![CDATA[<p>works like a charm. Found another tutorial on the imagemagick website that shows how to generate multiple images and put them together as a prgressive gif making look like a slide show. I&#8217;ll try and find the link to it again and post it here</p>
]]></content:encoded>
	</item>
</channel>
</rss>

