Repository navigation
try to solve #13381 - #13382
try to solve #13381#13382
Conversation
44be4a9 to
38870b7
Compare
| // TODO Add runtime configuration | ||
| #define CV_IO_MAX_IMAGE_PARAMS (50) | ||
| #define CV_IO_MAX_IMAGE_WIDTH (1<<20) | ||
| #define CV_IO_MAX_IMAGE_HEIGHT (1<<20) |
There was a problem hiding this comment.
Please remove "TODO" comment too and perform reading of these options once (example, but probably inside of validateInputImageSize() function).
| uint64 pixels = (uint64)size.width * (uint64)size.height; | ||
| CV_Assert(pixels <= CV_IO_MAX_IMAGE_PIXELS); | ||
| uint64 minSizeFile = utils::getConfigurationParameterSizeT("OPENCV_IO_MAX_IMAGE_WIDTH", 1 << 20)*utils::getConfigurationParameterSizeT("OPENCV_IO_MAX_IMAGE_HEIGHT", 1 << 20); | ||
| CV_Assert(pixels <= utils::getConfigurationParameterSizeT("OPENCV_IO_MAX_IMAGE_PIXELS", std::min<size_t>(minSizeFile, std::numeric_limits<std::size_t>::max()>>2))); |
There was a problem hiding this comment.
-
minSizeFileis not needed. Max width, max height and max total number of pixels should stay different. Nobody want to allocate 128Gb on server due malformed input image. -
std::numeric_limits<std::size_t>::max()>>2- this threshold is very huge, so please keep defaults the same.
355189c to
d0848cf
Compare
|
Finally if I don't change CV_IO_MAX_IMAGE_PIXELS (1<<30) exception still occurs then can we change in 1<<31 ? |
|
@LaurentBerger Right. This behavior is expected. There is another description of the problem: #8511 |
|
Sorry my idea is bad. I don't change default value and I add a note in imread doc :
|
* try to solve opencv#13381 * Add note
resolves #13381