ETC/programing

고용량 이미지 주소

건담아빠 2024. 5. 22. 10:43

개발할때 이미지 크기별 테스트를 진행할때가 종종있다.

용량이 꽤큰 이미지가 필요할때 매번 찾기 귀찮아서 기록해 둔다.

 

 

https://commons.wikimedia.org/w/index.php?title=Category%3ALarge_images&source=post_page-----b6c0fea2a4f4--------------------------------#mw-category-media

 

Category:Large images - Wikimedia Commons

This is a list of very large images above 50 Megapixel, which can really slow down a computer. Images are added to this category by adding {{LargeImage}} to their image page. The content of this category is managed by a bot. <!-- NewPP limit report Parsed

commons.wikimedia.org

 

대충 이런식의 테스트를 위해서

application.yml

spring:
  security:
   debug: true
  ...
  servlet:
    multipart:
     maxFileSize: 10MB # 파일 하나의 최대 크기
     maxRequestSize: 30MB  # 한 번에 최대 업로드 가능 용량

 

upload

    const response = await request.upload(`/temp-images-new`, formData);
    if (response.status === 200) {
      const theFiles = response.DATA;
      for (let file of theFiles) {
        file.MODE = FILE_MODE.INSERT;
      }
      props.setFiles([...props.files, ...theFiles]);
    } else {
      let alertParams = {};
      if (response.RESULT_CD === 'ERR_9988') {
        alertParams = {
          title: <>파일은 최대 5개까지만 업로드 가능합니다.</>,
          buttons: [{ text: '확인', type: 'primary' }],
        };
      } else {
        alertParams = {
          title: <>파일 하나의 최대크기는 10MB, 한 번에 최대 업로드 가능 용량은 30MB 입니다.</>,
          buttons: [{ text: '확인', type: 'primary' }],
        };
      }

      props.alert(alertParams);
    }