1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #23108 from crackwitz:issue-23107

Usage of imread(): magic number 0, unchecked result

* docs: rewrite 0/1 to IMREAD_GRAYSCALE/IMREAD_COLOR in imread()

* samples, apps: rewrite 0/1 to IMREAD_GRAYSCALE/IMREAD_COLOR in imread()

* tests: rewrite 0/1 to IMREAD_GRAYSCALE/IMREAD_COLOR in imread()

* doc/py_tutorials: check imread() result
This commit is contained in:
Christoph Rackwitz
2023-01-09 01:55:31 -08:00
committed by GitHub
parent 7b7774476e
commit a64b51dd94
57 changed files with 129 additions and 74 deletions
+2 -2
View File
@@ -250,7 +250,7 @@ int main( int argc, char** argv )
{
int k1 = k == 0 ? 2 : k == 1 ? 0 : 1;
printf("%s\n", imageList[i*3+k].c_str());
view = imread(imageList[i*3+k], 1);
view = imread(imageList[i*3+k], IMREAD_COLOR);
if(!view.empty())
{
@@ -338,7 +338,7 @@ int main( int argc, char** argv )
{
int k1 = k == 0 ? 2 : k == 1 ? 0 : 1;
int k2 = k == 0 ? 1 : k == 1 ? 0 : 2;
view = imread(imageList[i*3+k], 1);
view = imread(imageList[i*3+k], IMREAD_COLOR);
if(view.empty())
continue;