mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 08:13:04 +04:00
Merge remote-tracking branch 'upstream/3.4' into merge-3.4
This commit is contained in:
@@ -253,6 +253,10 @@ bool TiffDecoder::readHeader()
|
||||
int wanted_channels = normalizeChannelsNumber(ncn);
|
||||
switch(bpp)
|
||||
{
|
||||
case 1:
|
||||
m_type = CV_MAKETYPE(CV_8U, photometric > 1 ? wanted_channels : 1);
|
||||
result = true;
|
||||
break;
|
||||
case 8:
|
||||
m_type = CV_MAKETYPE(CV_8U, photometric > 1 ? wanted_channels : 1);
|
||||
result = true;
|
||||
@@ -269,6 +273,8 @@ bool TiffDecoder::readHeader()
|
||||
m_type = CV_MAKETYPE(CV_64F, photometric > 1 ? 3 : 1);
|
||||
result = true;
|
||||
break;
|
||||
default:
|
||||
CV_Error(cv::Error::StsError, "Invalid bitsperpixel value read from TIFF header! Must be 1, 8, 16, 32 or 64.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ bool WebPEncoder::write(const Mat& img, const std::vector<int>& params)
|
||||
|
||||
if (channels == 1)
|
||||
{
|
||||
cvtColor(*image, temp, CV_GRAY2BGR);
|
||||
cvtColor(*image, temp, COLOR_GRAY2BGR);
|
||||
image = &temp;
|
||||
channels = 3;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user