diff --git a/src/utility/src/sequence.cpp b/src/utility/src/sequence.cpp index 22b0a26c6..8ee71327a 100644 --- a/src/utility/src/sequence.cpp +++ b/src/utility/src/sequence.cpp @@ -344,9 +344,11 @@ std::vector default_collapse_sequences(const std::vector &entri } int pad_size(const std::string &frame) { - // -01 == pad 3 - // 0 pad means unknown padding - return (std::to_string(std::atoi(frame.c_str())).size() == frame.size() ? 0 : frame.size()); + // The padding width is always the length of the frame string. + // e.g. "0001" -> 4, "1000" -> 4, "-01" -> 3, "" -> 0 (unknown) + // Previously, frames with no leading zeros (e.g. "1000") incorrectly + // returned 0, producing {:00d} URIs that failed to load any frame. + return static_cast(frame.size()); } std::string pad_spec(const int pad) {