projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a9effee
)
imgcodecs: fix 4 reading channel bmp images
author
berak
<px1704@web.de>
Sun, 1 Oct 2017 13:32:55 +0000
(15:32 +0200)
committer
berak
<px1704@web.de>
Sun, 1 Oct 2017 13:32:55 +0000
(15:32 +0200)
modules/imgcodecs/src/grfmt_bmp.cpp
patch
|
blob
|
history
diff --git
a/modules/imgcodecs/src/grfmt_bmp.cpp
b/modules/imgcodecs/src/grfmt_bmp.cpp
index
45e02ce
..
3817c41
100644
(file)
--- a/
modules/imgcodecs/src/grfmt_bmp.cpp
+++ b/
modules/imgcodecs/src/grfmt_bmp.cpp
@@
-481,8
+481,10
@@
decode_rle8_bad: ;
if( !color )
icvCvt_BGRA2Gray_8u_C4C1R( src, 0, data, 0, cvSize(m_width,1) );
- else
- icvCvt_BGRA2BGR_8u_C4C3R( src, 0, data, 0, cvSize(m_width,1) );
+ else if( img.channels() == 3 )
+ icvCvt_BGRA2BGR_8u_C4C3R(src, 0, data, 0, cvSize(m_width, 1));
+ else if( img.channels() == 4 )
+ memcpy(data, src, m_width * 4);
}
result = true;
break;