Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit c1ec1a2

Browse files
Add check for minimum image size requirement.
1 parent bbbb483 commit c1ec1a2

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

PixiCUDA/src/main.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ int main(int argc, char** argv)
4444
<< ";\n\t- Image width: " << image.cols
4545
<< ";\n\t- Image channels: " << image.channels() << ";\n";
4646

47+
if (image.rows < BYTE_SIZE || image.cols < BYTE_SIZE)
48+
{
49+
cerr << RED_BOLD << "Image is too small; Minimum size is " << BYTE_SIZE << "x" << BYTE_SIZE << ";\n";
50+
return ERROR_CODE;
51+
}
52+
4753
// This is the main window where all the magic happens
4854
namedWindow(WIN_NAME, WINDOW_NORMAL);
4955
resizeWindow(WIN_NAME, WIN_WIDTH, WIN_HEIGHT);

0 commit comments

Comments
 (0)