summaryrefslogtreecommitdiff
path: root/src/verify_j2k.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/verify_j2k.cc')
-rw-r--r--src/verify_j2k.cc19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/verify_j2k.cc b/src/verify_j2k.cc
index 48d85a33..455fdfa6 100644
--- a/src/verify_j2k.cc
+++ b/src/verify_j2k.cc
@@ -42,6 +42,7 @@
#include "raw_convert.h"
#include "verify.h"
#include "verify_j2k.h"
+#include <fmt/format.h>
#include <memory>
#include <vector>
@@ -158,7 +159,7 @@ dcp::verify_j2k (shared_ptr<const Data> j2k, vector<VerificationNote>& notes)
require_marker ("SIZ");
auto L_siz = get_16();
if (L_siz != 47) {
- throw InvalidCodestream("unexpected SIZ size " + raw_convert<string>(L_siz));
+ throw InvalidCodestream(fmt::format("unexpected SIZ size {}", L_siz));
}
get_16(); // CA: codestream capabilities
@@ -206,10 +207,10 @@ dcp::verify_j2k (shared_ptr<const Data> j2k, vector<VerificationNote>& notes)
get_8(); // tile part index
auto tile_parts = get_8();
if (!fourk && tile_parts != 3) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_TILE_PARTS_FOR_2K, raw_convert<string>(tile_parts) });
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_TILE_PARTS_FOR_2K, fmt::to_string(tile_parts) });
}
if (fourk && tile_parts != 6) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_TILE_PARTS_FOR_4K, raw_convert<string>(tile_parts) });
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_TILE_PARTS_FOR_4K, fmt::to_string(tile_parts) });
}
main_header_finished = true;
} else if (*marker_name == "SOD") {
@@ -228,11 +229,11 @@ dcp::verify_j2k (shared_ptr<const Data> j2k, vector<VerificationNote>& notes)
require_8(fourk ? 6 : 5, "invalid number of transform levels %1");
auto log_code_block_width = get_8();
if (log_code_block_width != 3) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_CODE_BLOCK_WIDTH, raw_convert<string>(4 * (2 << log_code_block_width)) });
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_CODE_BLOCK_WIDTH, fmt::to_string(4 * (2 << log_code_block_width)) });
}
auto log_code_block_height = get_8();
if (log_code_block_height != 3) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_CODE_BLOCK_HEIGHT, raw_convert<string>(4 * (2 << log_code_block_height)) });
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_CODE_BLOCK_HEIGHT, fmt::to_string(4 * (2 << log_code_block_height)) });
}
require_8(0, "invalid mode variations");
require_8(0, "invalid wavelet transform type %1"); // 9/7 irreversible
@@ -251,10 +252,10 @@ dcp::verify_j2k (shared_ptr<const Data> j2k, vector<VerificationNote>& notes)
auto quantization_style = get_8();
int guard_bits = (quantization_style >> 5) & 7;
if (fourk && guard_bits != 2) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_4K, raw_convert<string>(guard_bits) });
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_4K, fmt::to_string(guard_bits) });
}
if (!fourk && guard_bits != 1) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_2K, raw_convert<string>(guard_bits) });
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_GUARD_BITS_FOR_2K, fmt::to_string(guard_bits) });
}
ptr += L_qcd - 3;
} else if (*marker_name == "COC") {
@@ -326,10 +327,10 @@ dcp::verify_j2k (shared_ptr<const Data> j2k, vector<VerificationNote>& notes)
throw InvalidCodestream("more than one QCD marker found");
}
if (num_POC_in_main != 0 && !fourk) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER_COUNT_FOR_2K, raw_convert<string>(num_POC_in_main) });
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER_COUNT_FOR_2K, fmt::to_string(num_POC_in_main) });
}
if (num_POC_in_main != 1 && fourk) {
- notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER_COUNT_FOR_4K, raw_convert<string>(num_POC_in_main) });
+ notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INCORRECT_JPEG2000_POC_MARKER_COUNT_FOR_4K, fmt::to_string(num_POC_in_main) });
}
if (num_POC_after_main != 0) {
notes.push_back ({ VerificationNote::Type::BV21_ERROR, VerificationNote::Code::INVALID_JPEG2000_POC_MARKER_LOCATION });