提交 f1857030 编写于 作者: S Suleyman TURKMEN

bigtiff images reading

上级 60228d30
......@@ -112,6 +112,8 @@ static bool cv_tiffSetErrorHandler()
static const char fmtSignTiffII[] = "II\x2a\x00";
static const char fmtSignTiffMM[] = "MM\x00\x2a";
static const char fmtSignBigTiffII[] = "II\x2b\x00";
static const char fmtSignBigTiffMM[] = "MM\x00\x2b";
TiffDecoder::TiffDecoder()
{
......@@ -140,7 +142,9 @@ bool TiffDecoder::checkSignature( const String& signature ) const
{
return signature.size() >= 4 &&
(memcmp(signature.c_str(), fmtSignTiffII, 4) == 0 ||
memcmp(signature.c_str(), fmtSignTiffMM, 4) == 0);
memcmp(signature.c_str(), fmtSignTiffMM, 4) == 0 ||
memcmp(signature.c_str(), fmtSignBigTiffII, 4) == 0 ||
memcmp(signature.c_str(), fmtSignBigTiffMM, 4) == 0);
}
int TiffDecoder::normalizeChannelsNumber(int channels) const
......
......@@ -455,6 +455,29 @@ TEST(Imgcodecs_Tiff, read_multipage_indexed)
}
}
TEST(Imgcodecs_Tiff, read_bigtiff_images)
{
const string root = cvtest::TS::ptr()->get_data_path();
const string filenamesInput[] = {
"readwrite/BigTIFF.tif",
"readwrite/BigTIFFMotorola.tif",
"readwrite/BigTIFFLong.tif",
"readwrite/BigTIFFLong8.tif",
"readwrite/BigTIFFMotorolaLongStrips.tif",
"readwrite/BigTIFFLong8Tiles.tif",
"readwrite/BigTIFFSubIFD4.tif",
"readwrite/BigTIFFSubIFD8.tif"
};
for (int i = 0; i < 8; i++)
{
const Mat bigtiff_img = imread(root + filenamesInput[i], IMREAD_UNCHANGED);
ASSERT_FALSE(bigtiff_img.empty());
EXPECT_EQ(64, bigtiff_img.cols);
EXPECT_EQ(64, bigtiff_img.rows);
ASSERT_EQ(CV_8UC3, bigtiff_img.type());
}
}
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册