PHP | 애니메이션 gif 와 일반 gif 구분 하기
페이지 정보
작성자 관리자 작성일18-01-17 15:19 조회1,102회 댓글0건관련링크
본문
[애니메이션gif와일반gif구분]
function AniGifCheck($path){
$str = @file_get_contents($path);
$strChk = true;
$frameCnt = $idx = 0;
$gifFrame = chr(hexdec("0x21")).chr(hexdec("0xF9")).chr(hexdec("0x04"));
$gfLenth = strlen($gifFrame);
if( strlen($str) <= 0 ){
return 'Not Found';
exit;
}
while( $strChk == true ){
if( strpos($str, $gifFrame,$idx) ){
$frameCnt++;
$idx = strpos($str, $gifFrame,$idx)+$gfLenth;
$strChk = true;
} else if( $frameCnt >= 3 || !strpos($str, $gifFrame,$idx) ){
break;
}
}
return $frameCnt > 1 ? true : false;
}
ani gif인경우는 true 아니면 false를 반환합니다.
function AniGifCheck($path){
$str = @file_get_contents($path);
$strChk = true;
$frameCnt = $idx = 0;
$gifFrame = chr(hexdec("0x21")).chr(hexdec("0xF9")).chr(hexdec("0x04"));
$gfLenth = strlen($gifFrame);
if( strlen($str) <= 0 ){
return 'Not Found';
exit;
}
while( $strChk == true ){
if( strpos($str, $gifFrame,$idx) ){
$frameCnt++;
$idx = strpos($str, $gifFrame,$idx)+$gfLenth;
$strChk = true;
} else if( $frameCnt >= 3 || !strpos($str, $gifFrame,$idx) ){
break;
}
}
return $frameCnt > 1 ? true : false;
}
ani gif인경우는 true 아니면 false를 반환합니다.
[주소복사] https://www.goodsweb.kr/?u=D41JXJxX
SNS 알리기
핀터레스트
텔레그램로
블로그로
페이스북
트위터
카카오스토리
카톡 공유
관련 블로그
로딩중