|
|
|
@ -42,6 +42,8 @@ |
|
|
|
|
|
|
|
|
|
#include "test_precomp.hpp" |
|
|
|
|
|
|
|
|
|
#include <fstream> |
|
|
|
|
|
|
|
|
|
using namespace cv; |
|
|
|
|
using namespace std; |
|
|
|
|
|
|
|
|
@ -673,6 +675,36 @@ TEST(Imgcodecs_Tiff, decode_tile_remainder) |
|
|
|
|
CV_GrfmtReadTifTiledWithNotFullTiles test; test.safe_run(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
TEST(Imgcodecs_Tiff, decode_infinite_rowsperstrip) |
|
|
|
|
{ |
|
|
|
|
const uchar sample_data[142] = { |
|
|
|
|
0x49, 0x49, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x56, 0x54, |
|
|
|
|
0x56, 0x5a, 0x59, 0x55, 0x5a, 0x00, 0x0a, 0x00, 0x00, 0x01, |
|
|
|
|
0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, |
|
|
|
|
0x01, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x07, 0x00, |
|
|
|
|
0x00, 0x00, 0x02, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, |
|
|
|
|
0x08, 0x00, 0x00, 0x00, 0x03, 0x01, 0x03, 0x00, 0x01, 0x00, |
|
|
|
|
0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x03, 0x00, |
|
|
|
|
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x11, 0x01, |
|
|
|
|
0x04, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, |
|
|
|
|
0x15, 0x01, 0x03, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, |
|
|
|
|
0x00, 0x00, 0x16, 0x01, 0x04, 0x00, 0x01, 0x00, 0x00, 0x00, |
|
|
|
|
0xff, 0xff, 0xff, 0xff, 0x17, 0x01, 0x04, 0x00, 0x01, 0x00, |
|
|
|
|
0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x03, 0x00, |
|
|
|
|
0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, |
|
|
|
|
0x00, 0x00 |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const string filename = cv::tempfile(".tiff"); |
|
|
|
|
std::ofstream outfile(filename.c_str(), std::ofstream::binary); |
|
|
|
|
outfile.write(reinterpret_cast<const char *>(sample_data), sizeof sample_data); |
|
|
|
|
outfile.close(); |
|
|
|
|
|
|
|
|
|
EXPECT_NO_THROW(cv::imread(filename, IMREAD_UNCHANGED)); |
|
|
|
|
|
|
|
|
|
remove(filename.c_str()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
class CV_GrfmtReadTifMultiPage : public cvtest::BaseTest |
|
|
|
|
{ |
|
|
|
|
private: |
|
|
|
|