--------------------------------------
그누보드4에서 모바일 파일첨부시 세로사진이 옆으로 누워버리길래..
찾다가 기존에 쓰는 방법인 imagerotate()함수가 php버전이 낮으면 작동이 안되고 찾을수 없다고 나온다..
그래서 열심히 구글링 후 다른 방법을 찾았기에.. 여기에 남김..
중복이면 죄송.
--------------------------------------
function rotateImage($img, $rotation) {
$width = imagesx($img);
$height = imagesy($img);
switch($rotation) {
case 90: $newimg= @imagecreatetruecolor($height , $width );break;
case 180: $newimg= @imagecreatetruecolor($width , $height );break;
case 270: $newimg= @imagecreatetruecolor($height , $width );break;
case 0: return $img;break;
case 360: return $img;break;
}
if($newimg) {
for($i = 0;$i < $width ; $i++) {
for($j = 0;$j < $height ; $j++) {
$reference = imagecolorat($img,$i,$j);
switch($rotation) {
case 90: if(!@imagesetpixel($newimg, $j, $width - $i, $reference )){return false;}break;
case 180: if(!@imagesetpixel($newimg, $width - $i, ($height - 1) - $j, $reference )){return false;}break;
case 270: if(!@imagesetpixel($newimg, ($height - 1) - $j, $i, $reference )){return false;}break;
}
}
} return $newimg;
}
return false;
}
게시판 목록
프로그램
| 번호 | 제목 | 글쓴이 | 날짜 | 조회 |
|---|---|---|---|---|
| 30 |
아우겐나이스
|
21년 전 | 4056 | |
| 29 |
아우겐나이스
|
21년 전 | 4445 | |
| 28 |
아우겐나이스
|
21년 전 | 3467 | |
| 27 | 21년 전 | 5841 | ||
| 26 | 21년 전 | 3123 | ||
| 25 | 21년 전 | 6089 | ||
| 24 | 18년 전 | 3653 | ||
| 23 | 21년 전 | 3643 | ||
| 22 | 21년 전 | 4249 | ||
| 21 | 21년 전 | 3821 | ||
| 20 | 21년 전 | 4232 | ||
| 19 | 21년 전 | 6685 | ||
| 18 | 21년 전 | 4736 | ||
| 17 | 21년 전 | 6998 | ||
| 16 | 21년 전 | 4177 | ||
| 15 | 21년 전 | 2641 | ||
| 14 | 21년 전 | 4981 | ||
| 13 | 21년 전 | 3406 | ||
| 12 |
Recluse
|
21년 전 | 3890 | |
| 11 |
아우겐나이스
|
21년 전 | 3574 | |
| 10 |
Recluse
|
21년 전 | 3401 | |
| 9 | 21년 전 | 4008 | ||
| 8 | 21년 전 | 5181 | ||
| 7 | 21년 전 | 4771 | ||
| 6 | 21년 전 | 5697 | ||
| 5 | 21년 전 | 4123 | ||
| 4 | 21년 전 | 4855 | ||
| 3 | 21년 전 | 4747 | ||
| 2 | 21년 전 | 3250 | ||
| 1 | 22년 전 | 4345 |
댓글 작성
댓글을 작성하시려면 로그인이 필요합니다.
로그인하기