From: Ivan K. <ik...@di...> - 2024-11-08 21:37:22
|
Hello liborigin developers, I have noticed a problem reading some of my *.opj files. These are produced by an Origin version bundled with a fluorometer (CPYA 4.2979 99 W32). I seem to get wrong names for the spreadsheet contents: for example, for some (but not all) files and only some "excel" objects inside them I get the contents visible under "Sample - Blank XYZ" in Origin when I look at the spreadsheet named "Sample - Blank" in liborigin. If I resave the file in Origin 2018, the problem persists. If I remove spreadsheets to the right of the problematic one, the problem persists. If I remove "Sample - Blank XYZ" in Origin, save the file and look for the "Sample - Blank" spreadsheet in liborigin, I get an empty spreadsheet (0 rows, 0 columns). If I overwrite the contents of the spreadsheet in Origin, the problem persists. If I remove a spreadsheet to the left of the problematic one, the problem seems to vanish. The fluorometer software makes a lot of use of embedding, e.g. the first spreadsheet is actually a note extended over all the cells, and a lot of other spreadsheets are plots. I'm only interested in the data. Deleting the embeds doesn't seem to help. I was able to reduce a problematic file to slightly more than a megabyte, where the desired "Sample - Blank" spreadsheet actually shows up under the name "S1c/R1c Blank": # no data for name = "Sample - Blank" (gdb) p opj.parser.get()->excels[0].sheets[14] $19 = {<Origin::Window> = {name = "Sample - Blank", label = "", objectID = -1, hidden = false, state = Origin::Window::Normal, title = Origin::Window::Both, frameRect = {left = 0, top = 0, right = 0, bottom = 0}, creationDate = 0, modificationDate = 0, windowBackgroundColorGradient = Origin::NoGradient, windowBackgroundColorBase = {type = Origin::Color::Regular, { regular = 17 '\021', custom = "\021\000", starting = 17 '\021', column = 17 '\021'}}, windowBackgroundColorEnd = { type = Origin::Color::Regular, {regular = 17 '\021', custom = "\021\000", starting = 17 '\021', column = 17 '\021'}}}, maxRows = 30, loose = true, sheets = 1, columns = std::vector of length 0, capacity 0} # expected data (1, 2, 3, 4...) under the wrong name "S1c/R1c Blank" (gdb) p opj.parser.get()->excels[0].sheets[6] $23 = {<Origin::Window> = {name = "S1c/R1c Blank", label = "", objectID = -1, hidden = false, state = Origin::Window::Normal, title = Origin::Window::Both, frameRect = {left = 0, top = 0, right = 0, bottom = 0}, creationDate = 0, modificationDate = 0, windowBackgroundColorGradient = Origin::NoGradient, windowBackgroundColorBase = {type = Origin::Color::Regular, { regular = 17 '\021', custom = "\021\000", starting = 17 '\021', column = 17 '\021'}}, windowBackgroundColorEnd = { type = Origin::Color::Regular, {regular = 17 '\021', custom = "\021\000", starting = 17 '\021', column = 17 '\021'}}}, maxRows = 30, loose = true, sheets = 1, columns = std::vector of length 84, capacity 128 = {{name = "A", dataset_name = "DfAqDDD1_A@7", type = Origin::SpreadColumn::X, valueType = Origin::TextNumeric, valueTypeSpecification = 0, significantDigits = 6, decimalPlaces = 6, numericDisplayType = Origin::DefaultDecimalDigits, command = ";\r\n#range rS = $(page.tree.LTCONST.S1Blank)!;\r\nint numCols = rS.ncols; \r\n\r\nrange x = $(page.tree.LTCONST.S1Blank)!1;\r\nrange rx = 1;\r\nrx = x;\r\n\r\nint size = rx.GetSize();\r\ndouble start = rx[1];\r\ndouble "..., comment = "Sample - Blank\r\nnm", width = 9, index = 57, colIndex = 58, sheet = 6, numRows = 500, beginRow = 0, endRow = 500, data = std::vector of length 500, capacity 500 = {{ m_type = Origin::Variant::V_DOUBLE, {m_double = 1, m_string = 0x3ff0000000000000}, {m_type = Origin::Variant::V_DOUBLE, { m_double = 2, m_string = 0x4000000000000000}, {m_type = Origin::Variant::V_DOUBLE, { m_double = 3, m_string = 0x4008000000000000}, {m_type = Origin::Variant::V_DOUBLE, { m_double = 4, Here's the opjfile.log from opj2dat parsing the file: https://bin.disroot.org/?7aec684f4da18c25#95w11RmCAc9s8Fm4GN4wjMzuSrz8vpz9xUC84dYS74yh (please let me know if you prefer text/plain attachments or a different paste service that allows 500-kilobyte text samples) And here's the file itself (1.2M): https://upload.disroot.org/r/zDkxeNw0#Zbgf8qn178+R1IANaGV3WZzoNQ5uOcIKE5TvlXfnDdU= I will be really grateful if you help me fix the problem or share a few hints on how to debug it further. -- Best regards, Ivan |