added test for png encoding bug #2352
This commit is contained in:
parent
03daf44848
commit
58fb8692c3
@ -217,6 +217,7 @@ public:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#ifdef HAVE_PNG
|
#ifdef HAVE_PNG
|
||||||
TEST(Highgui_Image, write_big) { CV_GrfmtWriteBigImageTest test; test.safe_run(); }
|
TEST(Highgui_Image, write_big) { CV_GrfmtWriteBigImageTest test; test.safe_run(); }
|
||||||
#endif
|
#endif
|
||||||
@ -225,3 +226,32 @@ TEST(Highgui_Image, write_imageseq) { CV_GrfmtWriteSequenceImageTest test; test.
|
|||||||
|
|
||||||
TEST(Highgui_Image, read_bmp_rle8) { CV_GrfmtReadBMPRLE8Test test; test.safe_run(); }
|
TEST(Highgui_Image, read_bmp_rle8) { CV_GrfmtReadBMPRLE8Test test; test.safe_run(); }
|
||||||
|
|
||||||
|
#ifdef HAVE_PNG
|
||||||
|
class CV_GrfmtPNGEncodeTest : public cvtest::BaseTest
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void run(int)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
vector<uchar> buff;
|
||||||
|
Mat im = Mat::zeros(1000,1000, CV_8U);
|
||||||
|
//randu(im, 0, 256);
|
||||||
|
vector<int> param;
|
||||||
|
param.push_back(CV_IMWRITE_PNG_COMPRESSION);
|
||||||
|
param.push_back(3); //default(3) 0-9.
|
||||||
|
cv::imencode(".png" ,im ,buff, param);
|
||||||
|
|
||||||
|
// hangs
|
||||||
|
Mat im2 = imdecode(buff,CV_LOAD_IMAGE_ANYDEPTH);
|
||||||
|
}
|
||||||
|
catch(...)
|
||||||
|
{
|
||||||
|
ts->set_failed_test_info(cvtest::TS::FAIL_EXCEPTION);
|
||||||
|
}
|
||||||
|
ts->set_failed_test_info(cvtest::TS::OK);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
TEST(Highgui_Image, encode_png) { CV_GrfmtPNGEncodeTest test; test.safe_run(); }
|
||||||
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user