mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 07:13:02 +04:00
Merge pull request #26871 from MaximSmolskiy:fix-filestorage_io_test-test_base64-for-64-bit-integer-types
Support 64-bit integer types for FileStorage Base64 #26871 ### Pull Request Readiness Checklist Related to https://github.com/opencv/opencv/pull/26846#issuecomment-2618159277 OpenCV extra: https://github.com/opencv/opencv_extra/pull/1232 See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
@@ -208,6 +208,8 @@ int base64::icvCalcStructSize(const char *dt, int initial_size) {
|
||||
case 'i': { elem_max_size = std::max( elem_max_size, sizeof(int ) ); break; }
|
||||
case 'f': { elem_max_size = std::max( elem_max_size, sizeof(float ) ); break; }
|
||||
case 'd': { elem_max_size = std::max( elem_max_size, sizeof(double) ); break; }
|
||||
case 'I': { elem_max_size = std::max( elem_max_size, sizeof(int64_t)); break; }
|
||||
case 'U': { elem_max_size = std::max( elem_max_size, sizeof(uint64_t)); break; }
|
||||
default: break;
|
||||
}
|
||||
}
|
||||
@@ -347,6 +349,11 @@ size_t base64::RawDataToBinaryConvertor::make_to_binary_funcs(const std::string
|
||||
size = sizeof(double);
|
||||
pack.func = to_binary<double>;
|
||||
break;
|
||||
case 'I':
|
||||
case 'U':
|
||||
size = sizeof(uint64_t);
|
||||
pack.func = to_binary<uint64_t>;
|
||||
break;
|
||||
case 'r':
|
||||
default:
|
||||
CV_Error(cv::Error::StsError, "type is not supported");
|
||||
|
||||
Reference in New Issue
Block a user