Current section

Files

Jump to
thumbp CHANGELOG.md
Raw

CHANGELOG.md

# Changelog
## v0.2.1 (2026-08-06)
### Added
- Declared `nif_versions` explicitly so precompiled binaries cover NIF versions 2.15, 2.16, and 2.17.
### Changed
- Bounded `width` and `height` at 16383, the largest value a VP8 frame header can encode in its 14-bit dimension fields, and narrowed their typespecs to `1..16_383`. Oversized requests now return an error immediately instead of spending seconds of CPU and gigabytes of memory on a resize that libwebp rejects anyway.
- Bounded `target_size` at 2147483647, because libwebp stores it in a C `int` where larger values wrap negative.
- Reworded error messages, docstrings, and README for clarity. `"unknown options"` became `"unknown options provided"`, `"quality and target_size options are exclusive"` became `"quality and target_size are mutually exclusive"`, and `"body is empty"` was split into `"body must be a binary"` and `"body must not be empty"`. Code matching on these strings needs updating.
- Capitalized `JPEG` in the errors the NIF returns from the scaled JPEG decode path, such as `"jpeg decode failed"`, which is now `"JPEG decode failed"`.
- Documented the 1-16383 bound on `width` and `height` in the `create/3` docstring.
- Included `CHANGELOG.md` in the Hex package files.
- Moved the crate to Rust edition 2024 and declared `rust-version = "1.85"`, the minimum supported Rust version that edition requires.
### Fixed
- Fixed `create/3` and `create/4` raising `ArgumentError`, or returning a misleading reason, instead of returning `{:error, reason}` for non-integer `width`, `height`, `target_size`, and `effort`. Elixir's term ordering places numbers below every other type, so comparisons such as `"320" <= 0` evaluate to false and let invalid values reach the NIF; `is_integer/1` checks now reject them first.
- Rejected a non-binary or empty `body`, replacing a check that only caught `nil`.
- Rejected a list that is not a keyword list as `opts`. `Keyword.keys/1` raises on such a list, so a malformed option list crashed instead of returning an error. A non-list `opts` still fails the `is_list/1` guard on `create/4` and raises `FunctionClauseError` as before.
## v0.2.0 (2026-04-13)
### Added
- JPEG DCT-domain scale decoding via `jpeg-decoder` crate. Decodes at 1/2, 1/4, or 1/8 resolution to skip up to 63/64 of the IDCT work. When the DCT scale matches the exact target size, the resize step is skipped entirely.
- `effort` option (0-6) to control WebP encoding speed/size tradeoff.
### Changed
- Avoided unnecessary RGBA channel promotion for RGB inputs (e.g. JPEG) during resize and WebP encoding.
- Refactored option handling in `create/4` from pattern-match enumeration to keyword list extraction with centralized validation.
- Updated CI workflow: runner images, action versions, pinned Rust toolchain, added NIF 2.17.
### Fixed
- Fixed documentation to reflect actual default quality of 60 (was incorrectly documented as 75).
## v0.1.5 (2024-12-15)
### Fixed
- Fixed typespec for `create/4`.
- Updated for dialyzer compatibility.
## v0.1.4 (2024-11-27)
### Changed
- Changed `config.method` to address quality issues, especially for smaller images.
- Reduced extra function calls in `create/4`.
- Set Rust version to 1.82.0.
- Upgraded hex packages and crates.
## v0.1.3 (2024-01-01)
### Changed
- Changed the native function to return a tuple directly.
- Upgraded hex packages.
## v0.1.2 (2023-12-01)
### Changed
- Downgraded Linux build base of precompiled binaries back to Ubuntu 20.04.
- Upgraded hex packages.
## v0.1.1 (2023-11-28)
### Added
- Introduced `rustler_precompiled` package for precompiled NIF binaries.
## v0.1.0 (2023-11-28)
### Added
- Initial release with WebP thumbnail generation via Rust NIF.