½ÃÀÛÆäÀÌÁö·Î Áñ°Üã±âÃß°¡
·Î±×ÀÎ
ȸ¿ø°¡ÀÔ l Ã⼮üũ l ¸¶ÀÌÆäÀÌÁö l CGIMALL
ÀÚ·á½Ç »çÀÌÆ®µî·Ï ·©Å·100 ÇÁ·Î±×·¥¸®ºä °ü¸®ÀÚÃßõÀÚ·á Ãʺ¸°¡À̵å
Ä¿¹Â´ÏƼ
Àüü ÆîÃ帱â
Äü¸Þ´º¸µÅ© jquery , CSS , PHP , Javascript , ¹«·áÆùÆ® , ASP
»ó¼¼°Ë»ö
Ȩ > Ä¿¹Â´ÏƼ > °ñµåÆÁ »ó¼¼º¸±â
Ä¿¹Â´ÏƼ ±¸Àα¸Á÷
»çÀÌÆ®µî·Ï
Ŭ¶ó¿ìµåű×
Javascript
PHP
ASP
CSS
HTML
MYSQL
jquery
image
Mobile
API
slide
°Ô½ÃÆÇ
¸Þ´º
ÇöÀçÁ¢¼ÓÀÚ ¸í »õ·Î°íħ
°Ô½ÃÆÇŸÀÌƲ °ñµåÆÁ / »ó¼¼º¸±â
Æ®À§ÅÍ·Î º¸³»±â
Ãßõ¼ö 335 | Á¶È¸¼ö 5,792 | µî·ÏÀÏ 2002-06-11 14:44:39

´Ð³×ÀÓ

HappyCGI

Á¦¸ñ

[GD] °íÈ­Áú,À̹ÌÁö ºñÀ² À¯ÁöÀÇ ½æ³×ÀÏÀ» ¸¸µé¾îº¸ÀÚ.
³»¿ë
ÇØÇÇCGI ÀÔ´Ï´Ù.
php ÇÁ·Î±×·¡¸Ó·Î ÀüÇâÁß  ¶¡~  php ÀÚü ±â´ÉÀÎ ½æ³×ÀÏÀ» »ç¿ëÇÏ°Ô µÇ¸é
gif,jpg,png ¸ðµÎ È­ÁúÀÌ »ó´çÈ÷ ¶³¾îÁö´Â°É ¾Ë°ÔµÇ¾úÁö¿ä.
¾Æ·¡ ÁÖ¼Ò Âü°í.
http://forum.happycgi.com/board_detail.cgi?db=gold_tip&thread=5007

À§ ÁÖ¼Ò¿¡ ±×¸²À» º¸¸é »ó´çÈ÷ ±×¸²ÀÌ Èñ¹ÌÇϰųª »ö»óÀÌ º¯ÁúµÈ°É º¼¼ö ÀÖ½À´Ï´Ù.

¿ì¼± À߸øµÈ ½æ³×ÀÏÀ» ¸¸µå´Â ¹æ¹ýÀÔ´Ï´Ù.  ¸Ûµê~


[ÇÁ·Î±×·¥ÄÚµå]
<?php
//À̹ÌÁö »çÀÌÁ ±¸Çؼ­ 100Çȼ¿À» ±âÁØÀ¸·Î ÆÛ¼¾Æ®¸¦ ±¸ÇÑ´Ù.
// 100 Çȼ¿Àº ½æ³×ÀÏ °¡·ÎÀ̹ÌÁö°¡ µÇ°í
// ¼¼·Î´Â ¿øº»ºñÀ²¿¡ ¸Â°Ô ±¸ÇÑ´Ù.
$gi_joon = "100";
$imagehw = GetImageSize("test.jpg");
$imagewidth = $imagehw[0];
$imageheight = $imagehw[1];
$new_height = $imageheight * $gi_joon / $imagewidth ;
$new_height=ceil($new_height);
$new_width = $gi_joon;

//php ±âº» ÇÔ¼ö¸¦ »ç¿ëÇؼ­ ½æ³×ÀÏÀ» ¸¸µç´Ù.
$src = ImageCreateFromJPEG("test.jpg");
$thumb = ImageCreate($new_height,$new_width);
ImageCopyResized($thumb,$src,0,0,0,0,$new_width,$new_height,ImageSX($src),ImageSY($src));
ImageJPEG($thumb,"thumb/test.jpg");  // thumb ¶ó´Â Æú´õ¿¡ test.jpg ¶ó´Â ½æ³×ÀÏÀ» ¸¸µç´Ù.
ImageDestroy($thumb);
?>



Çغ¸½Ã¸é ¾Æ½Ã°ÚÁö¸¸
»ó´çÈ÷ Ä÷¸®Æ¼°¡ ¶³¾îÁö´Â ½æ³×ÀÏÀÌ ¸¸µé¾îÁý´Ï´Ù.
http://www.php.net ¿¡ º¸¸é
ImageJPEG($thumb,"thumb/test.jpg");
¶ó´Â ¿É¼Ç¿¡
ImageJPEG($thumb,"thumb/test.jpg",100);
°ú °°Àº ¹æ½ÄÀ¸·Î Ä÷¸®Æ¼¸¦ Á¶ÀýÇÒ¼ö ÀÖ´Ù°í µÇ¾îÀÖÁö¸¸
½Ç»ó ÅëÇÏÁö ¾Ê½À´Ï´Ù. (php ¹öÁ¯À̳ª GD ¶óÀ̺귯¸®¿¡ µû¶ó¼­ ´Ù¸§)

¿Ã¹Ù¸¥ Äڵ带 º¾´Ï´Ù.  



[ÇÁ·Î±×·¥ÄÚµå]
<?php

//À̹ÌÁö »çÀÌÁ ±¸Çؼ­ 100Çȼ¿À» ±âÁØÀ¸·Î ÆÛ¼¾Æ®¸¦ ±¸ÇÑ´Ù.
// 100 Çȼ¿Àº ½æ³×ÀÏ °¡·ÎÀ̹ÌÁö°¡ µÇ°í
// ¼¼·Î´Â ¿øº»ºñÀ²¿¡ ¸Â°Ô ±¸ÇÑ´Ù.
$gi_joon = "100";
$imagehw = GetImageSize("test.jpg");
$imagewidth = $imagehw[0];
$imageheight = $imagehw[1];

$new_height = $imageheight * $gi_joon / $imagewidth ;

$new_height=ceil($new_height);
$new_width = $gi_joon;

$src = ImageCreateFromJPEG("test.jpg");
$thumb = ImageCreate($new_width,$new_height);

$thumb = imagecreatetruecolor($new_width,$new_height);
imagecopyresampled($thumb,$src,0,0,0,0,$new_width,$new_height,imagesx($src),imagesy($src));
ImageJPEG($thumb,"thumb/test.jpg");
ImageDestroy($thumb);
?>



ÁÁÀº ÇÏ·çµÇ¼¼¿ä.
Ãßõ½ºÅ©·¦¼Ò½ºº¸±â ¸ñ·Ï
ÀÌÀü°Ô½Ã±Û ÀÚ¹Ù½ºÅ©¸³Æ®·Î ÀÌÀüÀ¸·Î µ¹¾Æ°¡±â¸¦ ¸µÅ©°ÉÀÚ 2002-06-07 18:47:03
´ÙÀ½°Ô½Ã±Û [ÆÁ] ±Û ³»¿ë¿¡ ÇÏÀÌÆÛ¸µÅ©¸¦ ÀÚµ¿À¸·Î °É¾îº¸ÀÚ. 2002-06-21 18:19:52