From 6badb46c94ecd1ae007329d07af57b6ce8632ad1 Mon Sep 17 00:00:00 2001 From: liduo Date: Wed, 18 Sep 2024 19:31:05 +0800 Subject: [PATCH] fix compile failed with empty extensionPath Signed-off-by: liduo --- src/compression_parser.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/compression_parser.cpp b/src/compression_parser.cpp index 9852db4..9dd3bf0 100644 --- a/src/compression_parser.cpp +++ b/src/compression_parser.cpp @@ -97,8 +97,8 @@ uint32_t CompressionParser::Init() } cJSON *contextNode = cJSON_GetObjectItem(root_, "context"); if (!ParseContext(contextNode)) { - cerr << NEW_LINE_PATH << filePath_ << endl; - return RESTOOL_ERROR; + cout << NEW_LINE_PATH << filePath_ << endl; + return RESTOOL_SUCCESS; } if (!LoadImageTranscoder()) { return RESTOOL_ERROR; @@ -162,25 +162,25 @@ bool CompressionParser::ParseCompression(const cJSON *compressionNode) bool CompressionParser::ParseContext(const cJSON *contextNode) { if (!contextNode) { - cerr << "Error: if image transcoding is supported, the 'context' node cannot be empty."; + cout << "Warning: if image transcoding is supported, the 'context' node cannot be empty."; return false; } if (!cJSON_IsObject(contextNode)) { - cerr << "Error: 'context' must be object."; + cout << "Warning: 'context' must be object."; return false; } cJSON *extensionPathNode = cJSON_GetObjectItem(contextNode, "extensionPath"); if (!extensionPathNode) { - cerr << "Error: if image transcoding is supported, the 'extensionPath' node cannot be empty."; + cout << "Warning: if image transcoding is supported, the 'extensionPath' node cannot be empty."; return false; } if (!cJSON_IsString(extensionPathNode)) { - cerr << "Error: 'extensionPath' must be string."; + cout << "Warning: 'extensionPath' must be string."; return false; } extensionPath_ = extensionPathNode->valuestring; if (extensionPath_.empty()) { - cerr << "Error: 'extensionPath' value cannot be empty."; + cout << "Warning: 'extensionPath' value cannot be empty."; return false; } return true;