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:
@@ -123,6 +123,15 @@ ImageEncoder BaseImageEncoder::newEncoder() const
|
||||
return ImageEncoder();
|
||||
}
|
||||
|
||||
void BaseImageEncoder::throwOnEror() const
|
||||
{
|
||||
if(!m_last_error.empty())
|
||||
{
|
||||
std::string msg = "Raw image encoder error: " + m_last_error;
|
||||
CV_Error( CV_BadImageSize, msg.c_str() );
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* End of file. */
|
||||
|
Reference in New Issue
Block a user