0
세로 이미지를 모바일에서 업로드 할 때 데스크톱/브라우저에서 열 때 올바른 방향으로 저장되지 않는 문제를 해결하려고합니다. 업로드가 바탕 화면에 완료되면이미지 업로드 "오리 엔테이션"exif 데이터를 가져 오지 못함
$exif = exif_read_data($_FILES["file"]["tmp_name"], 0, true);
Error: Unexpected token a in JSON at position 0; array(4) {
["FILE"]=>
array(6) {
["FileName"]=>
string(11) "php18A7.tmp"
["FileDateTime"]=>
int(1490020599)
["FileSize"]=>
int(382988)
["FileType"]=>
int(2)
["MimeType"]=>
string(10) "image/jpeg"
["SectionsFound"]=>
string(19) "ANY_TAG, IFD0, EXIF"
}
["COMPUTED"]=>
array(5) {
["html"]=>
string(26) "width="2041" height="3628""
["Height"]=>
int(3628)
["Width"]=>
int(2041)
["IsColor"]=>
int(1)
["ByteOrderMotorola"]=>
int(1)
}
["IFD0"]=>
array(6) {
["ACDComment"]=>
string(37) "Windows Photo Editor 10.0.10011.16384"
["Orientation"]=>
int(8)
["Software"]=>
string(37) "Windows Photo Editor 10.0.10011.16384"
["DateTime"]=>
string(19) "2017:03:20 14:32:13"
["Exif_IFD_Pointer"]=>
int(2242)
["UndefinedTag:0xEA1C"]=>
string(2060) "�
}
}
위에 표시된 오류가
var_dump($exif)
입니다
: 내가 올바른 방향으로 변경하는 EXIF 데이터를 얻기 위해 아래의 코드를 사용하고 있지만이 문제가 있어요
브라우저. 따라서 표시된 것처럼 "Orientation"데이터를 가져 오지만 모바일에서 수행하면 "FILE"배열과 "COMPUTED"배열 만 검색하고 "Orientation"데이터는 포함하지 않습니다.