<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.0.4" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Image manipulation with PHP &#038; the GD library, Part 2</title>
	<link>http://phpit.net/article/image-manipulation-php-gd-part2/</link>
	<description>PHPit has dozens of PHP articles, codesnippets and FAQ's.</description>
	<pubDate>Sun, 31 Aug 2008 11:12:12 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>

	<item>
		<title>by: intekhab alam</title>
		<link>http://phpit.net/article/image-manipulation-php-gd-part2/#comment-12083</link>
		<pubDate>Tue, 29 Aug 2006 14:58:41 +0000</pubDate>
		<guid>http://phpit.net/article/image-manipulation-php-gd-part2/#comment-12083</guid>
					<description>it help me to solve my problem so thanyou very much.</description>
		<content:encoded><![CDATA[<p>it help me to solve my problem so thanyou very much.
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Jawad Shuaib</title>
		<link>http://phpit.net/article/image-manipulation-php-gd-part2/#comment-11955</link>
		<pubDate>Mon, 28 Aug 2006 07:41:34 +0000</pubDate>
		<guid>http://phpit.net/article/image-manipulation-php-gd-part2/#comment-11955</guid>
					<description>Thank you so much for this tutorial. This is exactly what I was looking for :) Thank you!</description>
		<content:encoded><![CDATA[<p>Thank you so much for this tutorial. This is exactly what I was looking for :) Thank you!
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Ramesh N Sharma</title>
		<link>http://phpit.net/article/image-manipulation-php-gd-part2/#comment-11873</link>
		<pubDate>Thu, 24 Aug 2006 09:42:15 +0000</pubDate>
		<guid>http://phpit.net/article/image-manipulation-php-gd-part2/#comment-11873</guid>
					<description>short and useful tutorial</description>
		<content:encoded><![CDATA[<p>short and useful tutorial
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: Harry D</title>
		<link>http://phpit.net/article/image-manipulation-php-gd-part2/#comment-11803</link>
		<pubDate>Wed, 23 Aug 2006 07:51:12 +0000</pubDate>
		<guid>http://phpit.net/article/image-manipulation-php-gd-part2/#comment-11803</guid>
					<description>Hi vish,

while watching your code I found  header(’Content-type: $image_type’); and  header(’Content-type: image/jpeg’);.
You can only send one header at once, not two. Just use the last one to make sure everything gets done before you put the resized image on screen.

Then, if you need to resize gif and png you need another header, so implement a switch case i.e. to get the type and use the right functions for these types.

best regards,

Harald Doderer
Director Emedian Ltd.
www.emedian.net</description>
		<content:encoded><![CDATA[<p>Hi vish,</p>
<p>while watching your code I found  header(’Content-type: $image_type’); and  header(’Content-type: image/jpeg’);.<br />
You can only send one header at once, not two. Just use the last one to make sure everything gets done before you put the resized image on screen.</p>
<p>Then, if you need to resize gif and png you need another header, so implement a switch case i.e. to get the type and use the right functions for these types.</p>
<p>best regards,</p>
<p>Harald Doderer<br />
Director Emedian Ltd.<br />
<a href='http://www.emedian.net' rel='nofollow'>www.emedian.net</a>
</p>
]]></content:encoded>
				</item>
	<item>
		<title>by: vish</title>
		<link>http://phpit.net/article/image-manipulation-php-gd-part2/#comment-11531</link>
		<pubDate>Sat, 19 Aug 2006 10:55:28 +0000</pubDate>
		<guid>http://phpit.net/article/image-manipulation-php-gd-part2/#comment-11531</guid>
					<description>Hi 
i want to resample an image to half its original size but there are not properly done 
using  the following code so please help me for solving the code :

0) {
  $row = mysql_fetch_array ($result);
  $percent = 0.5; //ex
  
  
  $image_type = $row["image_type"];
  $image = $row["image"];
  $image_name = $row["image_name"];
 
 header('Content-type: $image_type');
 
 // Get new dimensions
 	$width = imagesx($image);
	$height = imagesx($image);

   $new_width = $width * $percent;
  $new_height = $height * $percent;

// Resample
	$image_p = imagecreatetruecolor($new_width,$new_height);
	$imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);
// Output
           header('Content-type: image/jpeg');
	imagejpeg($image_p);
	  

            Regards ,
            vish                
  
  

}
?&#62;</description>
		<content:encoded><![CDATA[<p>Hi<br />
i want to resample an image to half its original size but there are not properly done<br />
using  the following code so please help me for solving the code :</p>
<p>0) {<br />
  $row = mysql_fetch_array ($result);<br />
  $percent = 0.5; //ex</p>
<p>  $image_type = $row[&#8221;image_type&#8221;];<br />
  $image = $row[&#8221;image&#8221;];<br />
  $image_name = $row[&#8221;image_name&#8221;];</p>
<p> header(&#8217;Content-type: $image_type&#8217;);</p>
<p> // Get new dimensions<br />
 	$width = imagesx($image);<br />
	$height = imagesx($image);</p>
<p>   $new_width = $width * $percent;<br />
  $new_height = $height * $percent;</p>
<p>// Resample<br />
	$image_p = imagecreatetruecolor($new_width,$new_height);<br />
	$imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);<br />
// Output<br />
           header(&#8217;Content-type: image/jpeg&#8217;);<br />
	imagejpeg($image_p);</p>
<p>            Regards ,<br />
            vish                </p>
<p>}<br />
?&gt;
</p>
]]></content:encoded>
				</item>
</channel>
</rss>
