Bugfixes:
- Fixed writing palettes with non-power-of-two sizes
Features:
- Added
Iterator
interface for theDecoder
- Added reading number of loop repetitions
Decoder::repeat
. - Added
skip_frame_decoding
option to readFrame.buffer
as LZW data. It works together withwrite_lzw_pre_encoded_frame
for quick rewriting of GIF files. - Added support pre-allocated
Vec
s infrom_palette_pixels
- Added ability to recover the
io::Read
er after decoding. - Added support for decompressing
Frame.buffer
with LZW data, which enables fully parallel GIF re-encoding (see examples/parallel.rs),
Optimization:
- Less buffering, copying, and lower peak memory usage.
Other changes:
- Removed
unsafe {}
code. - Enforced memory limit also on metadata extension blocks, and added out-of-memory checks where possible.
EncodingFormatError
enum is public.- Removed defunct
skip_extensions
- Added validation of frame dimensions. The buffer must be large enough for all pixels, and if the width or height is 0, the buffer must be empty.
Features:
- Add compression of pre-compressed frame data, via
Encoder::write_lzw_pre_encoded_frame
. - The
color_quant
dependency is now optional. Turning it off disables some interfaces that would internally build quantization tables. The generic implementation of creating such tables can be prohibitively costly compared to specialized algorithms in some use cases.
Optimization:
- Avoid some allocations in by replacing
flat_map
argument with arrays
Bufixes:
- Fix decoding confusing superfluous image data from previous frames with current frame data.
- Bump minimum required version of
weezl
.
Features:
- Add
Encoder::{get_ref, get_mut, into_inner}
to access underlying stream.
Bugfixes:
- Fix panic while decoding some images, has no precise cause in the file.
- Warn about
set_extensions
being unimplemented...
Features:
- Added
StreamingDecoder::version
to query the precise version of the standard used for encoding the file. This is merely a hint. - Added
DecodeOptions::allow_unknown_blocks
to skip over unknown or unspecified block kinds.
Optimization:
Frame::from_rgba
now recognizes when less than 256 colors are being used, dynamically skipping the quantization phase.- Encoding image chunks is faster and simpler
- Fix panic when LZW code size is invalid
- Added option to omit check for lzw end code
- Frames out-of-bounds of the screen descriptor are again accepted by default.
- Added
DecodeOptions::check_frame_consistency
to turn this validation on.
- Rename
Reader
toDecoder
. - Reworked
Decoder
intoDecodeOptions
. - The decoding error is now opaque and no longer allocates a string. Adding more information or more error conditions is forward compatible.
- Replace the lzw decoder with
weezl
, up to +350% throughput. - The dysfunctional C-API has been (temporarily?) removed
- It may get reintroduced as a separate crate at some point
- Added a
std
feature. It must be active for now.