Index: /branches/dev/data/lib/gdthumb.php
===================================================================
--- /branches/dev/data/lib/gdthumb.php	(revision 12056)
+++ /branches/dev/data/lib/gdthumb.php	(revision 12057)
@@ -137,6 +137,5 @@
           			$imageresize($dst_im, $src_im, 0, 0, 0, 0, $re_size[0], $re_size[1], $size[0], $size[1]);
 
-					if(function_exists("imagegif")) {
-						
+					if(function_exists("imagegif")) {						
 						// ²èÁü½ÐÎÏ
 						if($header){
@@ -145,8 +144,12 @@
 							return "";
 						}else{
-							$dst_file = $dst_file . ".gif";
-							imagegif($dst_im, $dst_file);
-						}
-						
+                            $dst_file = $dst_file . ".gif";
+		                    if($re_size[0] == $size[0] && $re_size[1] == $size[1]) {
+		                        // ¥µ¥¤¥º¤¬Æ±¤¸¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤¹¤ë¡£(²è¼ÁÎô²½¤òËÉ¤°¡Ë           
+		                        copy($path, $dst_file);
+		                    } else {
+		                        imagegif($dst_im, $dst_file);
+		                    }
+						}						
 						imagedestroy($src_im);
 						imagedestroy($dst_im);
@@ -158,6 +161,11 @@
 							return "";
 						}else{
-							$dst_file = $dst_file . ".png";						
-							imagepng($dst_im, $dst_file);
+							$dst_file = $dst_file . ".png";
+		                    if($re_size[0] == $size[0] && $re_size[1] == $size[1]) {
+		                        // ¥µ¥¤¥º¤¬Æ±¤¸¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤¹¤ë¡£(²è¼ÁÎô²½¤òËÉ¤°¡Ë           
+		                        copy($path, $dst_file);
+		                    } else {
+		                        imagepng($dst_im, $dst_file);
+		                    }
 						}
 						imagedestroy($src_im);
@@ -207,5 +215,5 @@
                     
                     if($re_size[0] == $size[0] && $re_size[1] == $size[1]) {
-                        // ¥µ¥¤¥º¤¬Æ±¤¸¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤¹¤ë¡£           
+                        // ¥µ¥¤¥º¤¬Æ±¤¸¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤¹¤ë¡£(²è¼ÁÎô²½¤òËÉ¤°¡Ë       
                         copy($path, $dst_file);
                     } else {
@@ -247,5 +255,10 @@
 				}else{
 					$dst_file = $dst_file . ".png";
-					imagepng($dst_im, $dst_file);
+                    if($re_size[0] == $size[0] && $re_size[1] == $size[1]) {
+                        // ¥µ¥¤¥º¤¬Æ±¤¸¾ì¹ç¤Ë¤Ï¡¢¤½¤Î¤Þ¤Þ¥³¥Ô¡¼¤¹¤ë¡£(²è¼ÁÎô²½¤òËÉ¤°¡Ë           
+                        copy($path, $dst_file);
+                    } else {
+                        imagepng($dst_im, $dst_file);
+                    }
 				}
 				imagedestroy($src_im);
