티스토리 뷰

QT

[QT] QImage 자동 회전 문제

developer0hye 2021. 6. 6. 15:06

이미지 파일의 헤더 포맷에 촬영시 카메라 방향에 대한 정보가 저장될 수 있나보다.

 

https://github.com/developer0hye/Yolo_Label/issues/49

 

rotating · Issue #49 · developer0hye/Yolo_Label

tool randomly rotates images look how picture looks like in labeling tool and in my folder

github.com

 

https://stackoverflow.com/questions/15123340/qimage-loads-with-wrong-orientation-for-certain-images

 

QImage loads with wrong orientation for certain images

I am instantiating a QImage from an image file like below and subsequently rendering it on a QWidget. QImage ( const QString & fileName, const char * format = 0 ) For most images, everything ...

stackoverflow.com

 

위 링크는 스택 오버 플로에 올라온 관련 이슈 링크이다.

 

QImageReader imgReader( imagePath );
imgReader.setAutoTransform( true );
QImage img = imgReader.read();

 

이렇게 이미지를 로드하면 해당 문제가 해결된다.

'QT' 카테고리의 다른 글

[QT] Sort filenames naturally with Qt  (0) 2021.05.23
[Qt] Mouse Wheel up down 이벤트  (0) 2021.03.15
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
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
글 보관함