불당썸, 에디터 사용시 썸네일 생성 에러 근본적인 해결방법 > 그누4 팁자료실

그누4 팁자료실

그누보드4와 관련된 팁을 여러분들과 함께 공유하세요.
나누면 즐거움이 커집니다.

불당썸, 에디터 사용시 썸네일 생성 에러 근본적인 해결방법 정보

불당썸, 에디터 사용시 썸네일 생성 에러 근본적인 해결방법

본문

불당썸, 에디터 사용시 썸네일 생성 에러 근본적인 해결방법입니다
보통 크롬으로 글쓸때 이런 오류가 발생하던데요..
img 태그 순서때문에 발생한 오류 인데요
저의 경우를 예로 들자면
크롬에서올릴때는

<img src="http://uani.wowip.kr/data/cheditor4/1301/fbd52e0c2c7b61a501bf424960aecd3f_6wLR6duQjfSSZFKrF.png" width="171" height="200" alt="유애니.png" style="border: none" />

이렇게 src,width,height,alt,style 순으로 나와버려서
리스트에서 $list[$i]["wr_content"] 이걸로 사진을 뽑을때 이미지 주소가
http://uani.wowip.kr/data/cheditor4/1301/fbd52e0c2c7b61a501bf424960aecd3f_6wLR6duQjfSSZFKrF.png" width="171" height="200" alt="유애니.png"
이렇게 나와서 오류가 나버리죠

익스플로러에서 이미지를 올리면
<img width="171" height="200" style="border: currentColor" alt="유애니.png" src="http://uani.wowip.kr/data/cheditor4/1301/fbd52e0c2c7b61a501bf424960aecd3f_yaF3ccsWuEzjMtUNduT.png" />

width,height,style,alt,src 순으로나와서 썸생성이 가능해지죠
그런데 사실 알고보니 익스플로러에서 오류로 썸이 생성되는 거더라구요

cheditor5/cheditor.js에서 2030번째줄 부근을 보면

img.setAttribute('src', attr.src);
img.setAttribute('width', attr.width);
img.setAttribute('height', attr.height);
img.setAttribute('alt', attr.alt ? attr.alt : attr.info.origName);
img.style.border = 'none';

이렇게 되잇어요 순서가 크롬에서 올라가는 순서(src,width,height,alt,style) 그대로죠?
그래서 크롬의 오류가 아니라 익스플로러의 오류로 썸이 생성되는 거라는 걸 알앗어요..
정말.. 싫네요 익스플로러는 하여튼 저걸 순서를 바꿔서

img.setAttribute('width', attr.width);
img.setAttribute('height', attr.height);
img.setAttribute('alt', attr.alt ? attr.alt : attr.info.origName);
img.setAttribute('src', attr.src);
img.style.border = 'none';

이렇게 수정해주면(img.setAttribute('src', attr.src); 이게 4번째 줄로 이동)
width,height,alt,src,style 순으로 배열이 오류가 안나겟죠

이상 php초보의 불당썸, 에디터 사용시 썸네일 생성 에러 해결방법이엇습니다~
추천
3

댓글 2개

전체 3,313 |RSS
그누4 팁자료실 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT