Skip to content

v0.39.0 - 2026-11-29

Latest

Choose a tag to compare

@jmcnamara jmcnamara released this 29 Nov 21:22
· 17 commits to master since this release

This release contains a large number of fixes for panics, hangs and large
allocations when reading malformed files. It also contains some breaking
changes, listed below. This is the first in a series of releases that aim to
harden calamine.

These fixes and changes may result in regressions where calamine now rejects a
file that it parsed previously, even if it was unintentional. If you encounter a
case like that, please open a bug report and we will review it.

Changed

  • Breaking: Range::from_sparse() now returns a Result with a
    CellLimitExceeded error when the range would hold more than MAX_CELLS
    (100 million) cells. Previously a worksheet with cells far apart, such as
    A1 and XFD1048576, could abort the process while allocating the range.
    Issue #693 and PR #697.

  • Breaking: The public error enums Error, XlsxError, XlsbError,
    XlsError, OdsError, DeError and VbaError are now #[non_exhaustive]
    so that new error variants can be added without a breaking change. The
    unused XlsError::InvalidFormat, OdsError::AttrError and
    OdsError::EncodingError variants were removed.

  • Breaking: CellErrorType is now #[non_exhaustive] and has variants
    for the newer Excel error values such as #SPILL! and #CALC!. In XLSX
    files, error values that aren't recognized are returned as
    CellErrorType::Other instead of failing the whole sheet. Issue #754 and
    PR #793.

  • Breaking: Replaced the built-in Compound File Binary (CFB) handling with
    the cfb crate. This changes the VbaProject::new() method and drops the
    VbaProject::from_cfb() method. It also raises the MSRV from 1.88 to 1.89.
    PR #551.

  • Updated zip from 9.0 to 9.1 in order to take advantage of additional
    protective features. Zip entry names are now matched as bytes, so a zip entry
    whose name isn't valid UTF-8 no longer causes an error when a file is opened.
    PR #772 and PR #826.

  • Improved XLS performance slightly by decoding compressed UTF-16LE strings
    without a temporary buffer. PR #809.

Added

  • Added support for reading shared and array formulas in XLSX, XLSB and XLS
    files. Previously only the first cell of a filled-down formula range in XLS
    and XLSB files returned a formula. Issue #443, PR #712, PR #808 and
    PR #788.

  • Added Xlsb::merge_cells_by_sheet_name() and
    Xlsb::merge_cells_by_sheet_id() to read merged cells from XLSB files,
    matching the existing XLSX and XLS methods. PR #768.

Fixed

  • Fixed XLS and XLSB formulas being returned with the wrong columns, $
    markers or sheets in cell references. PR #776 and PR #779.

  • Fixed XLS and XLSB formulas being returned without quotes around sheet
    names, so that a reference to 'My Sheet'!A1 was returned as
    My Sheet!A1. PR #780.

  • Fixed >= and > being swapped in formulas returned from XLS and XLSB
    files. PR #788.

  • Fixed XLSB formulas that use the intersection or union reference operators,
    such as =SUM(A1:B2 B1:C3), failing with a Ptg error. PR #777.

  • Fixed XLSB formula cells whose cached value is an error, such as a
    VLOOKUP() that returns #N/A, being read as empty cells. PR #775.

  • Fixed XLSX and XLSB workbooks that contain an Excel 4.0 macro sheet failing
    to open. Issue #802 and PR #803.

  • Fixed XLS defined names with array constants being read from the wrong
    bytes, which could also panic for BIFF5 files. Issue #814 and PR #815.

  • Fixed XLS number formats being ignored when the Format record had an
    unexpected id. Issue #798 and PR #804.

  • Fixed number formats where an _, \ or * inside quoted text inverted the
    quoting of the rest of the format. PR #828.

  • Fixed ODS reading of rows with whitespace-only text between cell elements.
    Issue #743 and PR #744.

  • Fixed XLSX reading of reversed dimension references such as C5:A1, which
    caused an underflow. Issue #692 and PR #695.

  • Fixed XLSX table data being shortened by the header row count instead of the
    totals row count. PR #829.

  • Fixed the following issues with malformed or crafted files, which now return
    an error or are read correctly instead of causing a panic, a hang or a large
    allocation:

    • XLSX cell references beyond the grid limits, such as XFE1 or
      A1048577. Issue #694 and PR #696.
    • XLSX shared string tables with a very large uniqueCount. Issue #684
      and PR #797.
    • XLSX shared formulas with a very large index, tables with very large
      ranges or row counts, and tables or pivot tables for sheets at the root of
      the file. PR #829.
    • XLSB records with out-of-range indexes or short lengths. Issue #799 and
      PR #800.
    • XLS sheet offsets past the end of the workbook stream and short workbook
      records. Issue #818, PR #822 and PR #823.
    • XLS DIMENSIONS records with a very large range. Issue #806 and
      PR #807.
    • XLS files and VBA projects with malformed compound file structures.
      Issue #764 and PR #551.
    • ODS files with unclosed table:table or office:annotation elements,
      which looped forever. Issue #773 and PR #774.
    • Zip files whose local headers don't match the central directory, so that
      calamine and other tools could read different data from the same file.
      Issue #748 and PR #826.

What's Changed

New Contributors

Full Changelog: v0.38.0...v0.39.0