일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 속도기능개선
- react 상태
- Spring Security
- 에러
- 스프링 시큐리티
- react simple captcha
- Docker
- 백엔드 아키텍처
- 깃
- maven
- 배치파일로 JDK 버전변경
- react 심플캡차
- react 자동입력방지
- react 캡차
- git
- spring
- Security 로그인
- react captcha
- error
- 계층구조vs도메인구조
- SpringBoot
- 스프링
- spring error
- spring security 로그인
- 리액트 심플캡차
- build
- 스프링 시큐리티 로그인
- Spring Boot
- 리액트 캡차
- REACT
Archives
- Today
- Total
I can do it(Feat. DEV)
[Java/Spring]numbers of source raster bands and source color space components do not match 본문
개발자 모드/오류처리
[Java/Spring]numbers of source raster bands and source color space components do not match
까짓거 해보자 개발자 2023. 8. 22. 14:02728x90
홈페이지 유지보수 중 위와 같은 에러가 발생했다고 해서 찾아보니...
파일업로드할 때 이미지가 문제가 있으면 뜨는 에러라고 함.
이미지 문제?? 일단 개발 환경에서 테스트 진행해 봄.
알고 보니 썸네일을 생성하는 코드 쪽에서 이미지를 읽어오는데 위와 같은 에러가 발생함.
근데 이미지를 확인해도 문제가 없어 보임.
갓글의 힘을 빌려 검색을 해보니 이미지에는 확장자 말고 타입이란 게 있는데,
RGB 또는 CMYK 등이 있다고 함.
근데 내가 읽으려고 하는 파일이 CMYK 타입의 이미지였던 것!
그래서
BufferedImage srcImg = ImageIO.read('읽으려는 파일 경로');
위 코드 부분에서 CMYK 타입의 이미지를 읽으려다 에러가 발생한 것!
해결 방법은 하단 참고 사이트에서 발견함.
POM.xml 파일에
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-jpeg</artifactId>
<version>3.7.0</version>
</dependency>
<dependency>
<groupId>com.twelvemonkeys.imageio</groupId>
<artifactId>imageio-tiff</artifactId>
<version>3.7.0</version>
</dependency>
위 코드를 추가하여 Maven reload를 하면 문제없이 파일을 읽어올 수 있음!!🤗
해당 라이브러리가 CMYK 타입의 이미지도 읽어올 수 있도록 해주는 것 같음👍
이상! 이미지 타입 관련 이슈 해결방법 끝😊
📢참고
https://blog.naver.com/yeolimprinting/222416447379
https://madinthe90.tistory.com/67
728x90
'개발자 모드 > 오류처리' 카테고리의 다른 글
[Maven]Fatal error compiling: invalid flag: --release (0) | 2023.08.29 |
---|---|
[Maven]There are test failures(feat. Failed to determine a suitable driver class) 에러 해결 방법 (0) | 2023.08.28 |
[Git] Spring Boot + React 프로젝트 git에 add 안될 때 (0) | 2023.05.04 |
Spring에서 ajax return 404 Error 날 때 (0) | 2023.03.08 |
[Error]The current branch master has no upstream branch. (0) | 2022.12.17 |