<?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: PHP Class: Image Snapshot 1.3</title>
	<atom:link href="http://blog.jc21.com/2006-06-11/image-snapshot/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.jc21.com/2006-06-11/image-snapshot/</link>
	<description>insert witty code here</description>
	<lastBuildDate>Wed, 17 Aug 2011 14:50:54 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: GÃƒÂ¼venlik kameras?</title>
		<link>http://blog.jc21.com/2006-06-11/image-snapshot/#comment-8529</link>
		<dc:creator>GÃƒÂ¼venlik kameras?</dc:creator>
		<pubDate>Thu, 26 Aug 2010 08:17:42 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jc21.com/archives/4#comment-8529</guid>
		<description>Thanks for sharing and info.</description>
		<content:encoded><![CDATA[<p>Thanks for sharing and info.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: JÃƒÂ¸rgen</title>
		<link>http://blog.jc21.com/2006-06-11/image-snapshot/#comment-8317</link>
		<dc:creator>JÃƒÂ¸rgen</dc:creator>
		<pubDate>Tue, 09 Feb 2010 12:01:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jc21.com/archives/4#comment-8317</guid>
		<description>Hi!

Thank you for this wonderful class! I just upgraded to version 2 but cant get the example work. I put the two files, and an image called test.jpg, in the same folder, and I changed the saveImage-location to the same folder. But the only thing that appears is :
&quot;Problem converting image! Make sure you are Loading it.
Cannot Save File: save.jpg NO DATA IN OUTPUTCould not save Image!
Output Width: 800px
Output Height: 600px &quot; 

Suggestions? 

Thanks
JÃƒÂ¸rgen</description>
		<content:encoded><![CDATA[<p>Hi!</p>
<p>Thank you for this wonderful class! I just upgraded to version 2 but cant get the example work. I put the two files, and an image called test.jpg, in the same folder, and I changed the saveImage-location to the same folder. But the only thing that appears is :<br />
&#8220;Problem converting image! Make sure you are Loading it.<br />
Cannot Save File: save.jpg NO DATA IN OUTPUTCould not save Image!<br />
Output Width: 800px<br />
Output Height: 600px &#8221; </p>
<p>Suggestions? </p>
<p>Thanks<br />
JÃƒÂ¸rgen</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jc</title>
		<link>http://blog.jc21.com/2006-06-11/image-snapshot/#comment-8187</link>
		<dc:creator>jc</dc:creator>
		<pubDate>Wed, 30 Sep 2009 22:58:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jc21.com/archives/4#comment-8187</guid>
		<description>There are a number of problems with the use of the class in your example. The main one, is that you&#039;re trying to tell the class that the contents of the image file is &quot;test.jpg&quot; - when in fact you mean to say that the contents is file_get_contents(&#039;test.jpg&#039;).

However, this 1.3 class is now superseded by a PHP 5.2+ version, Image Snapshot v2.0.  Although it works in the same way, it works with less code and more readability. The class methods have changed slightly, but should be self explanatory.

You can download it here:
blog.jc21.com/wp-content/code/image_snapshot_v2.0.zip</description>
		<content:encoded><![CDATA[<p>There are a number of problems with the use of the class in your example. The main one, is that you&#8217;re trying to tell the class that the contents of the image file is &#8220;test.jpg&#8221; &#8211; when in fact you mean to say that the contents is file_get_contents(&#8216;test.jpg&#8217;).</p>
<p>However, this 1.3 class is now superseded by a PHP 5.2+ version, Image Snapshot v2.0.  Although it works in the same way, it works with less code and more readability. The class methods have changed slightly, but should be self explanatory.</p>
<p>You can download it here:<br />
blog.jc21.com/wp-content/code/image_snapshot_v2.0.zip</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OxyMedia</title>
		<link>http://blog.jc21.com/2006-06-11/image-snapshot/#comment-8186</link>
		<dc:creator>OxyMedia</dc:creator>
		<pubDate>Wed, 30 Sep 2009 16:33:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jc21.com/archives/4#comment-8186</guid>
		<description>What&#039;s wrong here? :(

    include(&#039;snapshot.class.php&#039;);
    
    $myimage = new ImageSnapshot;
    $myimage-&gt;ImageContents = &#039;test.jpg&#039;;
    $myimage-&gt;Width = 307;
    $myimage-&gt;Height =  161;
    $myimage-&gt;Resize = true; //if false, snapshot takes a portion from the unsized image.
    $myimage-&gt;ResizeScale = 100;
    $myimage-&gt;Position = &#039;center&#039;;
    $myimage-&gt;Compression = 80;
    
    if ($myimage-&gt;ProcessImage() !== false) {
        $img = $myimage-&gt;GetImageContents();
    } else {
        echo $myimage-&gt;Err;
    }
    
    //saving to a filename
    if ($myimage-&gt;SaveImageAs(&#039;temp.jpg&#039;)) {
        echo &#039;ReturnedWidth . &#039;px;height:&#039; . $myimage-&gt;ReturnedHeight . &#039;px;border:1px solid #f00;&quot;&gt;ReturnedWidth . &#039;&quot; height=&quot;&#039; . $myimage-&gt;ReturnedHeight . &#039;&quot; alt=&quot;&quot; /&gt;&#039;;
    } else {
        echo $myimage-&gt;Err;
    }</description>
		<content:encoded><![CDATA[<p>What&#8217;s wrong here? :(</p>
<p>    include(&#8216;snapshot.class.php&#8217;);</p>
<p>    $myimage = new ImageSnapshot;<br />
    $myimage-&gt;ImageContents = &#8216;test.jpg&#8217;;<br />
    $myimage-&gt;Width = 307;<br />
    $myimage-&gt;Height =  161;<br />
    $myimage-&gt;Resize = true; //if false, snapshot takes a portion from the unsized image.<br />
    $myimage-&gt;ResizeScale = 100;<br />
    $myimage-&gt;Position = &#8216;center&#8217;;<br />
    $myimage-&gt;Compression = 80;</p>
<p>    if ($myimage-&gt;ProcessImage() !== false) {<br />
        $img = $myimage-&gt;GetImageContents();<br />
    } else {<br />
        echo $myimage-&gt;Err;<br />
    }</p>
<p>    //saving to a filename<br />
    if ($myimage-&gt;SaveImageAs(&#8216;temp.jpg&#8217;)) {<br />
        echo &#8216;ReturnedWidth . &#8216;px;height:&#8217; . $myimage-&gt;ReturnedHeight . &#8216;px;border:1px solid #f00;&#8221;&gt;ReturnedWidth . &#8216;&#8221; height=&#8221;&#8216; . $myimage-&gt;ReturnedHeight . &#8216;&#8221; alt=&#8221;" /&gt;&#8217;;<br />
    } else {<br />
        echo $myimage-&gt;Err;<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OxyMedia</title>
		<link>http://blog.jc21.com/2006-06-11/image-snapshot/#comment-8185</link>
		<dc:creator>OxyMedia</dc:creator>
		<pubDate>Wed, 30 Sep 2009 16:32:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jc21.com/archives/4#comment-8185</guid>
		<description>Very bad, nothing works, I can&#039;t put a simple image url working :(</description>
		<content:encoded><![CDATA[<p>Very bad, nothing works, I can&#8217;t put a simple image url working :(</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jc</title>
		<link>http://blog.jc21.com/2006-06-11/image-snapshot/#comment-8009</link>
		<dc:creator>jc</dc:creator>
		<pubDate>Wed, 01 Apr 2009 04:00:17 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jc21.com/archives/4#comment-8009</guid>
		<description>Using the GD library on a Windows distribution is sometimes buggy. Images sometimes come out with green bars and jibberish, or sometimes not at all.

I would analyse any log files and if there&#039;s no problem there, update your PHP GD DLL.</description>
		<content:encoded><![CDATA[<p>Using the GD library on a Windows distribution is sometimes buggy. Images sometimes come out with green bars and jibberish, or sometimes not at all.</p>
<p>I would analyse any log files and if there&#8217;s no problem there, update your PHP GD DLL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kyle</title>
		<link>http://blog.jc21.com/2006-06-11/image-snapshot/#comment-7999</link>
		<dc:creator>kyle</dc:creator>
		<pubDate>Wed, 18 Mar 2009 16:38:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jc21.com/archives/4#comment-7999</guid>
		<description>I am running this class in the Ajax File Browser on my Linux Server with apache2 and php5 and it works great!  However, I&#039;m also running on 2000 server in IIS and php5, and I don&#039;t get any thumbnails in the file info pane or in thumbnail view.  What am I missing?</description>
		<content:encoded><![CDATA[<p>I am running this class in the Ajax File Browser on my Linux Server with apache2 and php5 and it works great!  However, I&#8217;m also running on 2000 server in IIS and php5, and I don&#8217;t get any thumbnails in the file info pane or in thumbnail view.  What am I missing?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Razvan</title>
		<link>http://blog.jc21.com/2006-06-11/image-snapshot/#comment-7371</link>
		<dc:creator>Razvan</dc:creator>
		<pubDate>Sat, 22 Nov 2008 17:38:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jc21.com/archives/4#comment-7371</guid>
		<description>First of all I&#039;d like to thank you for this nice class. Nice job !

Second, I&#039;d like to tell you what I&#039;ve changed in order to work nicer with pictures which have only one dimension bigger than the desired result picture (only width or height, not both of them), maybe this is something who interests others too:

1. At line 247, I&#039;ve changed the &quot;AND&quot; comparison, with an &quot;OR&quot;:

if ($image_width &gt; $this-&gt;Width &lt;b&gt;&#124;&#124;&lt;/b&gt; $image_height &gt; $this-&gt;Height)

2. I&#039;ve changed the maxwidth / maxheight calculation in the if at line 254:

if ($w_ratio &lt; $h_ratio) {
					$maxheight = ceil($image_height * &lt;b&gt;$w_ratio&lt;/b&gt;); 					$maxwidth = ceil($image_width * &lt;b&gt;$w_ratio&lt;/b&gt;);
				} else {
					$maxwidth = ceil($image_width * &lt;b&gt;$h_ratio&lt;/b&gt;);
					$maxheight = ceil($image_height * &lt;b&gt;$h_ratio&lt;/b&gt;);
				}</description>
		<content:encoded><![CDATA[<p>First of all I&#8217;d like to thank you for this nice class. Nice job !</p>
<p>Second, I&#8217;d like to tell you what I&#8217;ve changed in order to work nicer with pictures which have only one dimension bigger than the desired result picture (only width or height, not both of them), maybe this is something who interests others too:</p>
<p>1. At line 247, I&#8217;ve changed the &#8220;AND&#8221; comparison, with an &#8220;OR&#8221;:</p>
<p>if ($image_width &gt; $this-&gt;Width <b>||</b> $image_height &gt; $this-&gt;Height)</p>
<p>2. I&#8217;ve changed the maxwidth / maxheight calculation in the if at line 254:</p>
<p>if ($w_ratio &lt; $h_ratio) {<br />
					$maxheight = ceil($image_height * <b>$w_ratio</b>); 					$maxwidth = ceil($image_width * <b>$w_ratio</b>);<br />
				} else {<br />
					$maxwidth = ceil($image_width * <b>$h_ratio</b>);<br />
					$maxheight = ceil($image_height * <b>$h_ratio</b>);<br />
				}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: smilecho</title>
		<link>http://blog.jc21.com/2006-06-11/image-snapshot/#comment-7311</link>
		<dc:creator>smilecho</dc:creator>
		<pubDate>Wed, 19 Nov 2008 13:48:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jc21.com/archives/4#comment-7311</guid>
		<description>Hello, great class. Thanks very match. First of all, excuse me for my bad English, but I have a question. When I use .gif file with transparency, the output is .jpg with black background. Can it be changed background color, or it is depend on my GD?</description>
		<content:encoded><![CDATA[<p>Hello, great class. Thanks very match. First of all, excuse me for my bad English, but I have a question. When I use .gif file with transparency, the output is .jpg with black background. Can it be changed background color, or it is depend on my GD?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jc</title>
		<link>http://blog.jc21.com/2006-06-11/image-snapshot/#comment-6309</link>
		<dc:creator>jc</dc:creator>
		<pubDate>Sun, 12 Oct 2008 23:52:05 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jc21.com/archives/4#comment-6309</guid>
		<description>That is outside the scope of this class. I&#039;ve made a separate class to handle mere image size conversions and not cropping.

http://blog.jc21.com/files/photo_resize_class.zip
PHP4 and PHP5 versions. This class has no documentation, you&#039;ll have to figure out the class methods yourself :) enjoy</description>
		<content:encoded><![CDATA[<p>That is outside the scope of this class. I&#8217;ve made a separate class to handle mere image size conversions and not cropping.</p>
<p><a href="http://blog.jc21.com/files/photo_resize_class.zip" rel="nofollow">http://blog.jc21.com/files/photo_resize_class.zip</a><br />
PHP4 and PHP5 versions. This class has no documentation, you&#8217;ll have to figure out the class methods yourself :) enjoy</p>
]]></content:encoded>
	</item>
</channel>
</rss>

