Improve error reporting of JPEG image encoder
OpenCV issue #2604 After this patch applied an attempt to encode empty images produces exception saying "Raw image encoder error: Empty JPEG image (DNL not supported)"
This commit is contained in:
@@ -282,3 +282,12 @@ TEST(Highgui_ImreadVSCvtColor, regression)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_JPEG
|
||||
TEST(Highgui_Jpeg, encode_empty)
|
||||
{
|
||||
cv::Mat img;
|
||||
std::vector<uchar> jpegImg;
|
||||
|
||||
ASSERT_THROW(cv::imencode(".jpg", img, jpegImg), cv::Exception);
|
||||
}
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user