imgcodecs: fix imwrite handling of different OutputArray types

pull/11565/head
Alexander Alekhin 7 years ago
parent 76ac7ab4ef
commit 35a4551609
  1. 7
      modules/imgcodecs/src/loadsave.cpp

@ -716,13 +716,10 @@ bool imwrite( const String& filename, InputArray _img,
{
CV_TRACE_FUNCTION();
std::vector<Mat> img_vec;
//Did we get a Mat or a vector of Mats?
if (_img.isMat() || _img.isUMat())
img_vec.push_back(_img.getMat());
else if (_img.isMatVector() || _img.isUMatVector())
if (_img.isMatVector() || _img.isUMatVector())
_img.getMatVector(img_vec);
else
CV_Error(Error::StsBadArg, "Unknown/unsupported input encountered");
img_vec.push_back(_img.getMat());
CV_Assert(!img_vec.empty());
return imwrite_(filename, img_vec, params, false);

Loading…
Cancel
Save