1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

Fixed bool type IO in FileStorage.

This commit is contained in:
Alexander Smorkalov
2026-05-21 11:48:33 +03:00
parent cc8f683b6a
commit 7a23e57680
2 changed files with 15 additions and 2 deletions
+1 -2
View File
@@ -2907,8 +2907,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);