mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2026-10-19 02:45:13 +02:00
Fixed seek bug in CtbRawFile (#373)
- seek to the edge of a file + read_into would select the wrong file - Visible for example in f.read_frame(index) in python Added fix, release notes and a small test. closes #371 Co-authored-by: AliceMazzoleni99 <alice.mazzoleni@psi.ch>
This commit is contained in:
+4
-4
@@ -24,9 +24,9 @@ void CtbRawFile::read_into(std::byte *image_buf, DetectorHeader *header) {
|
||||
throw std::runtime_error(LOCATION + " End of file reached");
|
||||
}
|
||||
|
||||
if (m_current_frame != 0 &&
|
||||
m_current_frame % m_master.max_frames_per_file() == 0) {
|
||||
open_data_file(m_current_subfile + 1);
|
||||
const auto index = sub_file_index(m_current_frame);
|
||||
if (index != m_current_subfile) {
|
||||
open_data_file(index);
|
||||
}
|
||||
|
||||
if (header) {
|
||||
@@ -79,4 +79,4 @@ void CtbRawFile::open_data_file(size_t subfile_index) {
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace aare
|
||||
} // namespace aare
|
||||
|
||||
Reference in New Issue
Block a user