RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR
웹&컴퓨팅  2007/06/01 19:57

썸네일 요고 색이 가네~
어찌 해야 될까?

$image_file_path="NSX.jpg";// : 변경전 이미지가 저장되어 있는 경로
$new_image_file_path="file/NSX.jpg";// : 썸네일 이미지가 저장될 디렉토리 경로
$max_width=300;// : 변경할 이미지의 폭
$max_height=200;// : 변경할 이미지의 높이
$return_val = 1;

$return_val = ( ($img = ImageCreateFromJPEG ( $image_file_path )) && $return_val == 1 ) ? "1" : "0";

$FullImage_width = imagesx ($img); // Original image width
$FullImage_height = imagesy ($img); // Original image height

$ratio = ( $FullImage_width > $max_width ) ? (real)($max_width / $FullImage_width) : 1 ;
$new_width = ((int)($FullImage_width * $ratio)); //full-size width
$new_height = ((int)($FullImage_height * $ratio)); //full-size height

$ratio = ( $new_height > $max_height ) ? (real)($max_height / $new_height) : 1 ;
$new_width = ((int)($new_width * $ratio)); //mid-size width
$new_height = ((int)($new_height * $ratio)); //mid-size height

if ( $new_width == $FullImage_width && $new_height == $FullImage_height )
copy ( $image_file_path, $new_image_file_path );

$full_id = ImageCreate( $new_width , $new_height );
ImageCopyResized( $full_id, $img, 0,0, 0,0, $new_width, $new_height, $FullImage_width, $FullImage_height );
$return_val = ( $full = ImageJPEG( $full_id, $new_image_file_path, 100 ) && $return_val == 1 ) ? "1" : "0";

2007/06/01 19:57 2007/06/01 19:57
http://www.x2chi.com/trackback/3
안치훈  | 2007/06/01 20:02
색깔 맛탱이 가는거 알았다~!

ImageCreate => ImageCreateTrueColor

좀더 업글해야지....
benefit of aerobic exercise  | 2008/03/13 05:42
너는 우수한 위치가 있는다!
x2chi:Leading the Web to its Full Potential...
(웹의 모든 잠재력을 이끌어 내기 위하여...)
Leading the Web to its Full Potential... (웹의 모든 잠재력을 이끌어 내기 위하여...)
전체 (832)
내 이야기 (443)
관심거리들 (159)
웹&컴퓨팅 (173)
(주) 프로홈 (19)
건강 (7)
«   2012/02   »
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29      
  1. generic cialis overnight  05:35
    Corporation began studying compound IC a phosph...
  2. cialis vs viagra vs levitra  05:35
    can decrease blood flow to the optic nerve of t...
  3. buy generic cialis  05:35
    Consider whether patients with underlying cardi...
  4. Jamie  04:37
    Salmeterol generic what does it look like, Salm...
  5. buy generic cialis in canada  04:30
    may cause dizziness drowsiness fainting or blur...
  1. x2chi's me2day  2011
    슈퍼스타의 생각
  2. x2chi's me2day  2011
    슈퍼스타의 생각
  3. x2chi's me2day  2011
    슈퍼스타의 생각
  4. x2chi's me2day  2010
    슈퍼스타의 생각
  5. x2chi's me2day  2010
    슈퍼스타의 생각
  1. 2012/01 (1)
  2. 2011/10 (1)
  3. 2011/09 (9)
  4. 2011/08 (16)
  5. 2011/07 (10)