반응형

get width, height: 이거는 상대적으로 간단

<img src='http://...jpg id='bgImg'>
document.getElementById('previewImg').width -> 화면에서 보이는 width
document.getElementById('previewImg').height
document.getElementById('previewImg').naturalWidth -> 이미지 원본크기
document.getElementById('previewImg').naturalHeight
document.getElementById('previewImg').clientWidth -> =width, width와 동일
document.getElementById('previewImg').clientHeigtht

아래처럼 Image 객체를 직접 생성해서 처리할 수도 있음 (<img> element만드는 것과 동일함)

const img = new Image();
img.onload = ()=>{
      alert("Current width=" + img.width + ", " + "Original height=" + img.height);
};
img.src='http://kic-qt2-ngfts.lge.com/fts/gftsDownload.lge?biz_code=CDP&func_code=PROGRAM_IMAGE&file_path=/cdp/program_image/test/skin/ncaa_back_fhd.jpg';

이미지가 load된 후에야 size정보를 파악할 수 있으므로 onLoad 이벤트 리스너를 붙여줘야함, 안그러면 async한 처리를 하다가 뭔가 틀어질 수 있음

<img onLoad = {(e)=>{e.target.xxxx}}>

 

 

size in byte: 문제는 이거,,,

response헤더에 정보가 담겨오면 헤더를 통해 알수 있음

'Content-Length'

http://kic-qt2-ngfts.lge.com/fts/gftsDownload.lge?biz_code=CDP&func_code=PROGRAM_IMAGE&file_path=/cdp/program_image/test/skin/ncaa_back_fhd.jpg
요청하면 Content-Length:110,019로 응답이 오며 실제 응답받은 파일사이즈도 110,019 (Byte)

request를 보내고 blob해서 알아낼수도 있음

let img = new Image()
img.crossOrigin = "Anonymous"; // Helps with some cross-origin issues

fetch('foo.png')
.then(response => response.blob())
.then(blob => { img.src = URL.createObjectURL(blob); })

위 방법써도 아래와 같은 CORS 에러발생
Access to fetch at 'http:/..jpg' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
const fileImg = await fetch(URL_TO_IMG).then(r => r.blob());
fileImg.size
 const size=performance.getEntriesByName('http://kic-qt2-ngfts.lge.com/fts/gftsDownload.lge?biz_code=CDP&func_code=PROGRAM_IMAGE&file_path=/cdp/program_image/test/skin/ncaa_back_fhd.jpg');
 잘은 모르겠으나 이것도 해보니 안됨

 

그런데 문제는.............

header를 통해 알아내거나 blob하려면 request를 직접 보내야 하는데 만약 CORS 이슈가 있다면 직접 응답을 받아내지 못함 -> 이거저거 다 시도해봤으나 안됨, 되게하려면

* 이미지 파일 response해주는 서버의 CORS정책을 바꾸거나

* client가 아니라 서버에서 요청을 대리하도록 만들어야 함

반응형
반응형

504 Gateway Timeout 서버 에러 응답 코드는 서버가
게이트웨이(gateway) 혹은 프록시(proxy)의 역할을 하는 동안 시간 안에 업스트림 서버(upstream server)로부터 요청을 마치기 위해 필요한 응답를 받지 못 했음
https://blog.lael.be/post/9251 - 설정좋음

Access to fetch at 'http://qt2-kic.channel.lgtvcommon.com/api/region/Global/status/S/update' from origin 'http://localhost:3000' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
https://stackoverflow.com/questions/22665232/what-can-cause-chrome-to-give-an-neterr-failed-on-cached-content-against-a-ser
https://developer.mozilla.org/ko/docs/Web/HTTP/CORS

2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> POST /api/region/Global/status/S/update
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> host: dev.channel.lgtvcommon.com
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> accept: /
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> accept-encoding: gzip, deflate, br
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> accept-language: ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNjEwNDk4NjA5LCJleHAiOjE2MTExMDM0MDl9.qqaJFk0-hysF8bMA1VxiWDB_f8d6rF_3N_lWHnJ3N8Z0D6ha7og994FoMf4r8N6bv4wGX-gKjPNlmfMAxpqiEQ
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> content-type: application/json
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> origin: https://dev.channel.lgtvcommon.com
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> referer: https://dev.channel.lgtvcommon.com/HOME-APP/tab
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> sec-fetch-dest: empty
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> sec-fetch-mode: cors
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> sec-fetch-site: same-origin
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> x-forwarded-for: 27.122.242.72
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> x-forwarded-port: 443
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> x-forwarded-proto: https
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> content-length: 0
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|> connection: keep-alive
2021-01-13 01:05:20.507 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|>
2021-01-13 01:05:20.512 [http-nio-8180-exec-10] INFO c.l.c.c.a.HomeAppAdminController - #updateAllByRegionAndStatus|currentUser=com.lge.cdp.security.UserPrincipal@20
2021-01-13 01:05:20.512 [http-nio-8180-exec-10] INFO c.l.c.c.a.HomeAppAdminController - #updateAllByRegionAndStatus|currentUser=com.lge.cdp.security.UserPrincipal@20
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< 200 OK
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< Vary: Origin
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< Vary: Access-Control-Request-Method
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< Vary: Access-Control-Request-Headers
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< Vary: Origin
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< Vary: Access-Control-Request-Method
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< Vary: Access-Control-Request-Headers
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< Vary: Origin
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< Vary: Access-Control-Request-Method
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< Vary: Access-Control-Request-Headers
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< Access-Control-Allow-Origin: *
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|<
2021-01-13 01:07:07.461 [http-nio-8180-exec-10] INFO c.l.c.f.LoggingFilter - 10.150.35.221|< {"result":"ok"}

2021-01-12 07:40:02.502 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> POST /api/region/Global/status/S/update
2021-01-12 07:40:02.502 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> host: qt2-kic.channel.lgtvcommon.com
2021-01-12 07:40:02.502 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> accept: /
2021-01-12 07:40:02.502 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> accept-encoding: gzip, deflate
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> accept-language: ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiIxIiwiaWF0IjoxNjEwNDM2OTg3LCJleHAiOjE2MTEwNDE3ODd9.LCAurM4nLxlHQI0dqtPFlh2H-r8cRSuxN1ytpFsntr9CwInUfHqjCXW-J15GFwHpfaXJyr0F0O8ECHzMdSEnRw
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> content-type: application/json
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> origin: http://localhost:3000
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> referer: http://localhost:3000/
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> x-forwarded-for: 27.122.242.72
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> x-forwarded-port: 80
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> x-forwarded-proto: http
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> content-length: 0
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|> connection: keep-alive
2021-01-12 07:40:02.503 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|>
2021-01-12 07:40:02.507 [http-nio-8180-exec-9] INFO c.l.c.c.a.HomeAppAdminController - #updateAllByRegionAndStatus|currentUser=com.lge.cdp.security.UserPrincipal@20
2021-01-12 07:41:48.838 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< 200 OK
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< Vary: Origin
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< Vary: Access-Control-Request-Method
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< Vary: Access-Control-Request-Headers
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< Vary: Origin
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< Vary: Access-Control-Request-Method
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< Vary: Access-Control-Request-Headers
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< Vary: Origin
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< Vary: Access-Control-Request-Method
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< Vary: Access-Control-Request-Headers
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< Access-Control-Allow-Origin: *
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|<
2021-01-12 07:41:48.839 [http-nio-8180-exec-9] INFO c.l.c.f.LoggingFilter - 10.150.32.229|< {"result":"ok"}

반응형
반응형

color="primary" LG붉은색, 주요컬러를 어디서 정할수 있는듯

color="secondary" 1차컬러, 2차컬러 이렇게 정할 수 있는듯, 이건 회색으로 나옴

color="inherit" 커스터마이징한 컬러가 아니라 material-ui에서 제공하는 기본 디폴트컬러인가??

반응형
반응형

http://mod.lge.com/prosys
GET http://mod.lge.com/prosys/config/server/info

  • Accept:application/json
  • Accept-Encoding:gzip, deflate
  • Accept-Language:ko-KR,ko;q=0.9,en-US;q=0.8,en;q=0.7
  • Connection:keep-alive
  • Cookie:GerritAccount=aHKuc2qtT1cOJKI46KHisOtAiVSQDpe; __utmz=106432414.1574130432.15.2.utmcsr=collab.lge.com|utmccn=(referral)|utmcmd=referral|utmcct=/main/pages/viewpage.action; crowd.token_key=Zky4bYQkNHV1FnFBhpopcw00; __utmc=106432414; __utma=106432414.1771813227.1573520850.1578534063.1578536233.101; login_success=T; ssolgenet=id=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nMWlV0NNPIU2CETmlhDAIo/PltZ6nnXBlM9u1hF+F4E4HxSUFD9rYaJU1aepxnkv8sQBSzf/dTUGT8ZN2sBzzvUgl/9Kr3/CJ+t7bvzq7; __utmb=106432414.5.10.1578536233; XSRF_TOKEN=aHKustHxrvq1rknkQI456dXOP7Vtzmm
  • Host:mod.lge.com
  • Referer:http://mod.lge.com/prosys/
  • User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.117 Safari/537.36
  • X-Gerrit-Auth:aHKustHxrvq1rknkQI456dXOP7Vtzmm
 
  •  
반응형
반응형
  • hover:
    • 공중을 맴돌다, 공중에 떠다니다, 공중부양하다, 마우스 커서의 공중부양
    • hover=mouseenter+mouseleave
    • mouse over, 마우스 커서가 닿는 것, 모든 element에 적용가능
  • mouse[enter/over]
    • mouseenter: 자식영역 감지X
    • mouseover: 자식영역까지 감지O
  • mouse[out/leave]
    • mouseleave: 자식영역빠져나가는 것 감지X 
    • mouseout: 자식영역빠져나가는 것 감지O
  • focus/blur
    • focus: 입력 커서가 있는 것, input element에 적용됨
    • blur: focus를 잃는 것?
  • toggle: 한개 스위치로 껏다켰다 하는 거
  • modal: ?

ellipsis 생략 말줄임

clipMode={'EllipsisWithTooltip'}
text-overflow: ellipsis;
반응형

+ Recent posts