Changelog History
Page 1
-
v0.24.4 Changes
๐ New Features:
- Encoding for
webp
is now available with the native library. This needs to be activate explicitly with theweb-encoder
feature. - ๐
exr
decoding has gained basic limit support.
๐ Bug fixes:
- ๐ The
Iterator::size_hint
implementation of pixel iterators has been fixed to return the current length indicated by itsExactSizeIterator
hint. - ๐ Typos and bad references in the documentation have been removed.
๐ Performance:
ImageBuffer::get_pixel{,_mut}
is now marked inline.resize
now short-circuits when image dimensions are unchanged.
- Encoding for
-
v0.24.3 Changes
๐ New Features:
- ๐
TiffDecoder
now supports setting resource limits.
๐ Bug fixes:
- ๐ Fix compile issues on little endian systems.
- Various panics discovered by fuzzing.
- ๐
-
v0.24.2 Changes
Structural changes:
- CI now runs
cargo-deny
, checking dependent crates to an OSS license list and against RUSTSEC advisories.
๐ New Features:
- The WebP decoder recognizes and decodes images with
VP8X
header. - The DDS decoder recognizes and decodes images with
DX10
headers.
๐ Bug fixes:
- Calling
DynamicImage
/ImageBuffer
's methodswrite_to
andsave
will now work properly even if the backing container is larger than the image layout requires. Only the relevant slice of pixel data is passed to the encoder. - ๐ Fixed a OOM-panic caused by malformed images in the
gif
decoder.
- CI now runs
-
v0.24.1 Changes
๐ Bug Fixes:
- ImageBuffer::get_pixel_checked would sometimes return the incorrect pixel.
- ๐ PNG encoding would sometimes not recognize unsupported color.
-
v0.24.0 Changes
๐ฅ Breaking changes
Structural changes:
- Minimum Rust version is now
1.56
and may change in minor versions until further notice. It is now tracked in the library'sCargo.toml
, instead, by the standard[package.rust-version]
field. Note: this applies to the library itself. You may need different version resolutions for dependencies when using a non-stable version of Rust. - ๐ The
math::utils::{nq, utils}
modules have been removed. These are better served through thecolor_quant
crate and the standard library respectively. - All codecs are now available through
image::codecs
, no longer top-level. ExtendedColorType
andDynamicImage
have been made#[non_exhaustive]
, providing more methods instead of exhaustive matching.- Reading images through the generic
io::Reader
, as well as generic convenience interfaces, now requires the underlying reader to beBufRead + Seek
. This allows more efficient support more formats. Similarly, writing now requires writers to beWrite + Seek
. - ๐ The
Bgra*
variants of buffers, which were only half-supported, have been removed. The owning buffer typesImageBuffer
andDynamicImage
fundamentally already make a choice in supported pixel representations. This allows for more consistent internal behavior. Callers are expected to convert formats when using those buffers, which they are required to do in any case already, and which is routinely performed by decoders.
Trait reworks:
- The
Pixel
trait is no longer implemented quite as liberally for structs defined in the crate. Instead, it is now restricted to a set of known channel which ensures accuracy in computations involving those channels. - The
ImageDecoderExt
trait has been renamed toImageDecoderRect
, according to its actual functionality. - The
Pixel
trait and itsSubpixel
field no longer require (or provide) a'static
lifetime bound. - The
Pixel
trait no longer requires specifying an associated, constantColorType
. This was of little relevance to computation but made it much harder to implement and extend correctly. Instead, the privatePixelWithColorType
extension is added for interfaces that require a properly known variant. - Reworked how
SubImage
interacts with theGenericImage
trait. It is now a default implementation. Note thatSubImage
now has inherent methods that avoid double-indirection, the trait's method will no longer avoid this. - The
Primitive
trait now requires implementations to provide a minimum and maximum logical bound for the purpose of converting to other primitive representations.
โ Additions
Image formats:
- ๐ Reading lossless WebP is now supported.
- ๐ The OpenEXR format is now supported.
- โฌ๏ธ The
jpeg
decoder has been upgraded to Lossless JPEG. - The
AvifEncoder
now correctly handles alpha-less images. Some additional color formats are converted to RGBA as well. - The
Bmp
codec now decodes more valid images. It can decode a raw image without performing the palette mapping. It provides a method to access the palette. The encoder provides the inverse capabilities. Tiff
is now an output format.
Buffers and Operations:
- ๐ The channel / primitive type
f32
is now supported. Currently only the OpenEXR codec makes full use of it but this is expected to change. ImageBuffer::{get_pixel_checked, get_pixel_mut_checked}
provide panic-free access to pixels and channels by returningOption<&P>
andOption<&mut P>
.ImageBuffer::write_to
has been added, encoding the buffer to a writer. This method already existed onDynamicImage
.- ๐
DynamicImage
now implementsFrom<_>
for all supported buffer types. - 0๏ธโฃ
DynamicImage
now implementsDefault
, an emptyRgba8
image. imageops::overlay
now takes coordinates asi64
.
Limits:
- โ Added
Limits
andLimitSupport
, utilized inio::Reader
. These can be configured for rudimentary protection against resource exhaustion (images pretending to require a very large buffer). These types are not yet exhaustive by design, and more and stricter limits may be added in the future. - ๐ Encoders that do provide inherent support for limits, or reserve a
significant amount of internal memory, are urged to implement the
set_limits
extension toImageDecoder
. Some strict limit are opt-in, which may cause decoding to fail if not supported.
Miscellaneous:
PNMSubtype
has been renamed toPnmSubtype
, by Rust's naming scheme.- ๐ Several incorrectly capitalized
PNM*
aliases have been removed. - Several
enum
types that had previously used a hidden variant now use the official#[non_exhaustive]
attribute instead.
- Minimum Rust version is now
-
v0.23.14 Changes
- Unified gif blending in different decode methods, fixing out-of-bounds checks in a number of weirdly positioned frames.
- Hardened TGA decoder against a number of malicious inputs.
- ๐ Fix forward incompatible usage of the panic macro.
๐ Fix load_rect for gif reaching
unreachable!()
code.โ Added
ExtendedColorType::A8
.๐ Allow TGA to load alpha-only images.
โก๏ธ Optimized load_rect to avoid unnecessary seeks.
-
v0.23.13 Changes
- ๐ Fix an inconsistency in supported formats of different methods for encoding an image.
- ๐ Fix
thumbnail
choosing an empty image. It now always prefer non-empty image dimensions. - ๐ Fix integer overflow in calculating requires bytes for decoded image buffers for farbfeld, hdr, and pnm decoders. These will now error early.
- ๐ Fix a panic decoding certain
jpeg
image without frames or meta data. - โก๏ธ Optimized the
jpeg
encoder. โก๏ธ Optimized
GenericImage::copy_from
default impl in various cases.โ Add
avif
decoders. You must enable it explicitly and it is not covered by our usual MSRV policy of Rust 1.34. Instead, only latest stable is supported.Add
ImageFormat::{can_read, can_write}
โ Add
Frame::buffer_mut
โ Add speed and quality options on
avif
encoder.โ Add speed parameter to
gif
encoder.๐ฆ Expose control over sequence repeat to the
gif
encoder.Add
{contrast,brighten,huerotate}_in_place
functions in imageproc.0๏ธโฃ Relax
Default
impl ofImageBuffer
, removing the bound on the color type.Derive Debug, Hash, PartialEq, Eq for DynamicImage
-
v0.23.12 Changes
- Fix a soundness issue affecting the impls of
Pixel::from_slice_mut
. This would previously reborrow the mutable input reference as a shared one but then proceed to construct the mutable result reference from it. While UB according to Rust's memory model, we're fairly certain that no miscompilation can happen with the LLVM codegen in practice. See 5cbe1e6767d11aff3f14c7ad69a06b04e8d583c7 for more details. - ๐ Fix
imageops::blur
panicking whensigma = 0.0
. It now defaults to1.0
as all negative values. ๐ Fix re-exporting
png::{CompressionType, FilterType}
to maintain SemVer compatibility with the0.23
releases.โ Add
ImageFormat::from_extension
โ Add copyless DynamicImage to byte slice/vec conversion.
Add bit-depth specific
into_
andto_
DynamicImage conversion methods.
- Fix a soundness issue affecting the impls of
-
v0.23.11 Changes
- The
NeuQuant
implementation is now supplied bycolor_quant
. Use of the type defined by this library is discouraged. - The
jpeg
decoder can now downscale images that are decoded by 1,2,4,8. - โก๏ธ Optimized the jpeg encoding ~5-15%.
- ๐ Deprecated the
clamp
function. Usenum-traits
instead. - The ICO decoder now accepts an empty mask.
- ๐ Fixed an overflow in ICO mask decoding potentially leading to panic.
- โ Added
ImageOutputFormat
forAVIF
- ๐ Updated
tiff
to0.6
with lzw performance improvements.
- The
-
v0.23.10 Changes
- โ Added AVIF encoding capabilities using the
ravif
crate. Please note that the feature targets the latest stable compiler and is not enabled by default. - โ Added
ImageBuffer::as_raw
to inspect the underlying container. - ๐ Updated
gif
to0.11
with large performance improvements.
- โ Added AVIF encoding capabilities using the