mirror of
https://github.com/opencv/opencv.git
synced 2025-06-09 18:43:05 +08:00
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:
parent
667e5e4f89
commit
e4ed2d2e42
@ -602,9 +602,9 @@ bool JpegEncoder::write( const Mat& img, const std::vector<int>& params )
|
|||||||
JpegErrorMgr jerr;
|
JpegErrorMgr jerr;
|
||||||
JpegDestination dest;
|
JpegDestination dest;
|
||||||
|
|
||||||
jpeg_create_compress(&cinfo);
|
|
||||||
cinfo.err = jpeg_std_error(&jerr.pub);
|
cinfo.err = jpeg_std_error(&jerr.pub);
|
||||||
jerr.pub.error_exit = error_exit;
|
jerr.pub.error_exit = error_exit;
|
||||||
|
jpeg_create_compress(&cinfo);
|
||||||
|
|
||||||
if( !m_buf )
|
if( !m_buf )
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user