This repository was archived by the owner on Mar 17, 2023. It is now read-only.
Update Rust crate image to 0.24.5 #3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
0.23.3->0.24.5Release Notes
image-rs/image
v0.24.5Compare Source
Structural changes:
tiffcrate to 0.8.0.jpegcrate to 0.3.0.Bug fixes:
as_rgb32ffunction ofDynamicImageis now correctly documented.images. The missing check could panic in debug mode or else set an incorrect
file size in release mode.
PngEncoder::write_imageinstead of the deprecated
PngEncoder::encodewhich did not account for byteorder and could result in images with incorrect colors.
InsufficientMemoryerror when trying to decode a PNG image.Performance:
performance in cases where the image does not need to be resized or has
already been resized.
v0.24.4Compare Source
New Features:
webpis now available with the native library. This needs tobe activate explicitly with the
web-encoderfeature.exrdecoding has gained basic limit support.Bug fixes:
Iterator::size_hintimplementation of pixel iterators has been fixed toreturn the current length indicated by its
ExactSizeIteratorhint.Performance:
ImageBuffer::get_pixel{,_mut}is now marked inline.resizenow short-circuits when image dimensions are unchanged.v0.24.3Compare Source
New Features:
TiffDecodernow supports setting resource limits.Bug fixes:
v0.24.2Structural changes:
cargo-deny, checking dependent crates to an OSS license listand against RUSTSEC advisories.
New Features:
VP8Xheader.DX10headers.Bug fixes:
DynamicImage/ImageBuffer's methodswrite_toandsavewill nowwork 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.
gifdecoder.v0.24.1Bug Fixes:
v0.24.0Compare Source
Breaking changes
Structural changes:
1.56and may change in minor versions untilfurther notice. It is now tracked in the library's
Cargo.toml, instead, bythe standard
[package.rust-version]field. Note: this applies to thelibrary itself. You may need different version resolutions for dependencies
when using a non-stable version of Rust.
math::utils::{nq, utils}modules have been removed. These are betterserved through the
color_quantcrate and the standard library respectively.image::codecs, no longer top-level.ExtendedColorTypeandDynamicImagehave been made#[non_exhaustive],providing more methods instead of exhaustive matching.
io::Reader, as well as genericconvenience interfaces, now requires the underlying reader to be
BufRead + Seek. This allows more efficient support more formats. Similarly, writingnow requires writers to be
Write + Seek.Bgra*variants of buffers, which were only half-supported, have beenremoved. The owning buffer types
ImageBufferandDynamicImagefundamentally 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:
Pixeltrait is no longer implemented quite as liberally for structsdefined in the crate. Instead, it is now restricted to a set of known channel
which ensures accuracy in computations involving those channels.
ImageDecoderExttrait has been renamed toImageDecoderRect, accordingto its actual functionality.
Pixeltrait and itsSubpixelfield no longer require (or provide) a'staticlifetime bound.Pixeltrait no longer requires specifying an associated, constantColorType. This was of little relevance to computation but made it muchharder to implement and extend correctly. Instead, the private
PixelWithColorTypeextension is added for interfaces that require aproperly known variant.
SubImageinteracts with theGenericImagetrait. It is now adefault implementation. Note that
SubImagenow has inherent methods thatavoid double-indirection, the trait's method will no longer avoid this.
Primitivetrait now requires implementations to provide a minimum andmaximum logical bound for the purpose of converting to other primitive
representations.
Additions
Image formats:
jpegdecoder has been upgraded to Lossless JPEG.AvifEncodernow correctly handles alpha-less images. Some additionalcolor formats are converted to RGBA as well.
Bmpcodec now decodes more valid images. It can decode a raw imagewithout performing the palette mapping. It provides a method to access the
palette. The encoder provides the inverse capabilities.
Tiffis now an output format.Buffers and Operations:
f32is now supported. Currently only theOpenEXR codec makes full use of it but this is expected to change.
ImageBuffer::{get_pixel_checked, get_pixel_mut_checked}provide panic-freeaccess to pixels and channels by returning
Option<&P>andOption<&mut P>.ImageBuffer::write_tohas been added, encoding the buffer to a writer. Thismethod already existed on
DynamicImage.DynamicImagenow implementsFrom<_>for all supported buffer types.DynamicImagenow implementsDefault, an emptyRgba8image.imageops::overlaynow takes coordinates asi64.Limits:
LimitsandLimitSupport, utilized inio::Reader. These can beconfigured 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.
significant amount of internal memory, are urged to implement the
set_limitsextension toImageDecoder. Some strict limit are opt-in, whichmay cause decoding to fail if not supported.
Miscellaneous:
PNMSubtypehas been renamed toPnmSubtype, by Rust's naming scheme.PNM*aliases have been removed.enumtypes that had previously used a hidden variant now use theofficial
#[non_exhaustive]attribute instead.v0.23.14Compare Source
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.13Compare Source
Fix an inconsistency in supported formats of different methods for encoding
an image.
Fix
thumbnailchoosing an empty image. It now always prefer non-empty imagedimensions.
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
jpegimage without frames or meta data.Optimized the
jpegencoder.Optimized
GenericImage::copy_fromdefault impl in various cases.Add
avifdecoders. You must enable it explicitly and it is not covered byour usual MSRV policy of Rust 1.34. Instead, only latest stable is supported.
Add
ImageFormat::{can_read, can_write}Add
Frame::buffer_mutAdd speed and quality options on
avifencoder.Add speed parameter to
gifencoder.Expose control over sequence repeat to the
gifencoder.Add
{contrast,brighten,huerotate}_in_placefunctions in imageproc.Relax
Defaultimpl ofImageBuffer, removing the bound on the color type.Derive Debug, Hash, PartialEq, Eq for DynamicImage
v0.23.12Compare Source
Fix a soundness issue affecting the impls of
Pixel::from_slice_mut. Thiswould 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
5cbe1e6for more details.Fix
imageops::blurpanicking whensigma = 0.0. It now defaults to1.0as all negative values.
Fix re-exporting
png::{CompressionType, FilterType}to maintain SemVercompatibility with the
0.23releases.Add
ImageFormat::from_extensionAdd copyless DynamicImage to byte slice/vec conversion.
Add bit-depth specific
into_andto_DynamicImage conversion methods.v0.23.11Compare Source
NeuQuantimplementation is now supplied bycolor_quant. Use of thetype defined by this library is discouraged.
jpegdecoder can now downscale images that are decoded by 1,2,4,8.clampfunction. Usenum-traitsinstead.ImageOutputFormatforAVIFtiffto0.6with lzw performance improvements.v0.23.10Compare Source
ravifcrate. Please note thatthe feature targets the latest stable compiler and is not enabled by default.
ImageBuffer::as_rawto inspect the underlying container.gifto0.11with large performance improvements.v0.23.9Compare Source
imageops::{vertical_gradient, horizontal_gradient}for writingsimple color gradients into an image.
Pixels,PixelsMut, etc. by using exactchunks internally. This should auto-vectorize
ImageBuffer::from_pixel.Cloneimpls of iterators to not require a bound on the pixel.Debugimpls for iterators where the pixel's channel implements it.FilterTypev0.23.8Compare Source
flat::Errornow implements the standardErrortraitMaphas been relaxed to?Sizedimageops::tilefunction that repeats one image across anotherv0.23.7Compare Source
ImageBuffercan now be clonedtgaencoderColorMap::lookup, an optional reversal of the mapEncodableLayouttrait is now exportedv0.23.6Compare Source
png::ApngDecoder, an adapter decoding the animation in an APNG.jpegencoding that would darken output colors.FlatSamples::with_monocolor.ImageBuffer::as_flat_samples_mutwhich is a mutable variant of theexisting ffi-helper
ImageBuffer::as_flat_samples.v0.23.5Compare Source
pngencoder now allows configuring compression and filter type. Theoutput is not part of stability guarantees, see its documentation.
jpegencoder now accepts any implementor ofGenericImageView. Thisallows images that are only partially present in memory to be encoded.
ImageBuffernow derivesHash,PartialEq,Eq.Pixels/PixelsMutiterator no longer yields out-of-bounds pixels whenthe underlying buffer is larger than required.
pbmdecoder correctly decodes ascii data again, fixing a regressionwhere it would use the sample value
1as white instead of255.gifframes.Rows/RowsMutiterator no longer panics when the image hasa width or height of
0.v0.23.4Compare Source
crop_immwhich functions likecropbut on a shared referenceDisposalMethod::Anyis treated asKeep, consistent with browsersError::sourceConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Mend Renovate. View repository job log here.