Skip to content

조회 수 108 추천 수 0 댓글 0
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

mobileex 에서만 되는 방법만 있어,

제가 한 방법을 적어봅니다.

저는 imageprocess module 에 image rotate 기능을 추가해서, 이미지 압축 처리할때, image orientation 정보를 이용해서

자동으로 회전하는 부분을 처리하였습니다.

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
30
31
32
33
34
35
if($file){
if($ext == "jpg" || $ext == "jpeg"){
$image = imagecreatefromjpeg($file);
}else if($ext == "png"){
$image = imagecreatefrompng($file);
}
else if($ext == "bmp" || $ext == "wbmp"){
$image = imagecreatefromwbmp($file);
}else if($ext == "gif"){
$image = imagecreatefromgif($file);
}
$exif = exif_read_data($file);
if(!empty($exif['Orientation'])) {
switch($exif['Orientation']) {
case 8:
$image = imagerotate($image,270,0);
break;
case 3:
$image = imagerotate($image,180,0);
break;
case 6:
$image = imagerotate($image,-90,0);
break;
}
if($ext == "jpg" || $ext == "jpeg"){
imagejpeg($image,$file);
} else if($ext == "png"){
imagepng($image,$file);
}else if($ext == "bmp" || $ext == "wbmp"){
imagewbmp($image,$file);
}else if($ext == "gif"){
imagegif($image,$file);
}
}
}


위에 코드를 imageprocess.controller.php 파일에

$ext = strtolower(substr(strrchr($args->source_filename,'.'),1));


소스 다음에 추가하시면, image orientation 되어 있는 파일이 자동으로 회전되어 올라가게 됩니다.

테스트 mobile 은 갤럭시s3, g2 기종으로 찍은 사진으로 해봤네요..


imageprocess module 설치되어 있으면, 기존 xe board 에서 pc / mobile 지원이 됩니다

?

List of Articles
번호 카테고리 제목 글쓴이 날짜 조회 수
1 동영상 마이러브 file 콩이아빠 2015.06.07 25
Board Pagination Prev 1 Next
/ 1

Korea NO.1 VISION 2020 / Designed by HJS_Sketch

sketchbook5, 스케치북5

sketchbook5, 스케치북5

나눔글꼴 설치 안내


이 PC에는 나눔글꼴이 설치되어 있지 않습니다.

이 사이트를 나눔글꼴로 보기 위해서는
나눔글꼴을 설치해야 합니다.

설치 취소