메뉴 건너뛰기

app

[PHP] imagecreatefromjpeg, imagejpeg 함수

박영식2008.07.11 17:13조회 수 4648댓글 0

    • 글자 크기
 list($width, $height) = getimagesize($filename);
 $newwidth = 500;
 $newheight = intval( 500/$width * $height);
 // Load
 $thumb = imagecreatetruecolor($newwidth, $newheight);
 $source = imagecreatefromjpeg($filename);
 // Resize
 imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);
 // Output
 imagejpeg($thumb, $fnst[$i]);

위의 루틴을 이용하여 이미지를 리사이징 할 수 있다.
그러기 위해서는 제목에 기입한 함수를 사용해야 한다.
flex에서 base64_incoding된 데이타를 base64_decoding하여 만든 파일은 png이므로, imagejpeg를 이용해 변환해야 한다. 그러기 위해서는 imagecreatefromjpeg함수를 사용해야 한다.

 이것을 하느라, 엄청난 시간을 소비해야만 했다. 우헉....
박영식 (비회원)
    • 글자 크기
[PHP] 이전 url체크와 구분자에서 맨 뒤의 값 얻기 (by 박영식) [js] gps좌표를 도분초로 나타내기 (by 박영식)

댓글 달기

이전 1 ... 4 5 6 7 8 9 10 11 12 13 14다음
첨부 (0)
위로