Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/utility/src/sequence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,11 @@ std::vector<Sequence> default_collapse_sequences(const std::vector<Entry> &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<int>(frame.size());
}

std::string pad_spec(const int pad) {
Expand Down
Loading