Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
cbda9b33
Commit
cbda9b33
authored
8 years ago
by
berak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imgcodecs: fix webp IMREAD_GRAYSCALE loading
parent
636ab095
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
0 deletions
+6
-0
grfmt_webp.cpp
modules/imgcodecs/src/grfmt_webp.cpp
+6
-0
No files found.
modules/imgcodecs/src/grfmt_webp.cpp
View file @
cbda9b33
...
...
@@ -162,6 +162,8 @@ bool WebPDecoder::readData(Mat &img)
{
if
(
m_width
>
0
&&
m_height
>
0
)
{
bool
convert_grayscale
=
(
img
.
type
()
==
CV_8UC1
);
// IMREAD_GRAYSCALE requested
if
(
img
.
cols
!=
m_width
||
img
.
rows
!=
m_height
||
img
.
type
()
!=
m_type
)
{
img
.
create
(
m_height
,
m_width
,
m_type
);
...
...
@@ -184,6 +186,10 @@ bool WebPDecoder::readData(Mat &img)
if
(
res_ptr
==
out_data
)
{
if
(
convert_grayscale
)
{
cvtColor
(
img
,
img
,
COLOR_BGR2GRAY
);
}
return
true
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment