fix JpegEncoder::write

3rdparty/libjpeg-turbo/src/jpeglib.h:
`* NB: you must set up the error-manager BEFORE calling jpeg_create_xxx.`
This commit is contained in:
hellodoge 2022-05-09 15:52:43 +03:00 committed by Waldemar
parent 667e5e4f89
commit e4ed2d2e42

View File

@ -602,9 +602,9 @@ bool JpegEncoder::write( const Mat& img, const std::vector<int>& params )
JpegErrorMgr jerr;
JpegDestination dest;
jpeg_create_compress(&cinfo);
cinfo.err = jpeg_std_error(&jerr.pub);
jerr.pub.error_exit = error_exit;
jpeg_create_compress(&cinfo);
if( !m_buf )
{