1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Merge pull request #29088 from asmorkalov:as/5.x_bool_io

Fixed bool type IO in FileStorage.
This commit is contained in:
Alexander Smorkalov
2026-05-21 13:29:59 +03:00
committed by GitHub
2 changed files with 15 additions and 2 deletions
+1 -2
View File
@@ -2921,8 +2921,7 @@ void read(const FileNode& node, std::string& val, const std::string& default_val
void FileStorage::Impl::write(const String &key, bool value)
{
CV_Assert(write_mode);
// [SWAP LOGIC]
if (fmt == FileStorage::FORMAT_YAML_1_0)
if (fmt != FileStorage::FORMAT_YAML)
{
// Legacy behavior: Write as integer 1 or 0
getEmitter().write(key.c_str(), (int)value);