Debian Codegraph @

.cargo/vendor/image/CHANGES.md

raw
1 # Release Notes
2
3 ## Known issues
4 - Many decoders will panic on malicious input.
5 - The color space information of pixels is not clearly communicated.
6
7 ## Changes
8
9 ### Version 0.25.9
10
11 Features:
12 - Support extracting XMP metadata from PNG, JPEG, GIF, WebP and TIFF files (#2567, #2634, #2644)
13 - Support reading IPTC metadata from PNG and JPG files (#2611)
14 - Support reading ICC profile from GIF files (#2644)
15 - Allow setting a specific DEFLATE compression level when writing PNG (#2583)
16 - Initial support for 16-bit CMYK TIFF files (#2588)
17 - Allow extracting the alpha channel of a `Pixel` in a generic way (#2638)
18
19 Structural changes:
20 - EXR format decoding now only uses multi-threading via Rayon when the `rayon` feature is enabled (#2643)
21 - Upgraded zune-jpeg to 0.5.x, ravif to 0.12.x, gif to 0.14.x
22 - pnm: parse integers in PBM/PGM/PPM headers without allocations (#2620)
23 - Replace `doc_auto_cfg` with `doc_cfg` (#2637)
24
25 Bug fixes:
26 - Do not encode empty JPEG images (#2624)
27 - tga: reject empty images (#2614)
28 - tga: fix orientation flip for color mapped images (#2607)
29 - tga: adjust colormap lookup to match tga 2.0 spec (#2608)
30
31 ### Version 0.25.8
32
33 Re-release of `0.25.7`
34
35 Fixes:
36 - Reverted a signature change to `load_from_memory` that lead to large scale
37 type inference breakage despite being technically compatible.
38 - Color conversion Luma to Rgb used incorrect coefficients instead of broadcasting.
39
40 ### Version 0.25.7 (yanked)
41
42 Features:
43 - Added an API for external image format implementations to register themselves as decoders for a specific format in `image` (#2372)
44 - Added [CICP](https://www.color.org/iccmax/download/CICP_tag_and_type_amendment.pdf) awarenes via [moxcms](https://crates.io/crates/moxcms) to support color spaces (#2531). The support for transforming is limited for now and will be gradually expanded.
45 - You can now embed Exif metadata when writing JPEG, PNG and WebP images (#2537, #2539)
46 - Added functions to extract orientation from Exif metadata and optionally clear it in the Exif chunk (#2484)
47 - Serde support for more types (#2445)
48 - PNM encoder now supports writing 16-bit images (#2431)
49
50 Structural changes:
51 - Increased MSRV to 1.85.0 (from 1.78.0)
52
53 API improvements:
54 - `save`, `save_with_format`, `write_to` and `write_with_encoder` methods on `DynamicImage` now automatically convert the pixel format when necessary instead of returning an error (#2501)
55 - Added `DynamicImage::has_alpha()` convenience method
56 - Implemented `TryFrom<ExtendedColorType>` for `ColorType` (#2444)
57 - Added `const HAS_ALPHA` to trait `Pixel`
58 - Unified the error for unsupported encoder colors (#2543)
59 - Added a `hooks` module to customize builtin behavior, `register_format_detection_hook` and `register_decoding_hook` for the determining format of a file and selecting an `ImageDecoder` implementation respectively. (#2372)
60
61 Performance improvements:
62 - Gaussian blur (#2496) and box blur (#2515) are now faster
63 - Improve compilation times by avoiding unnecessary instantiation of generic functions (#2468, #2470)
64
65 Bug fixes:
66 - Many improvements to image format decoding: TIFF, WebP, AVIF, PNG, GIF, BMP, TGA
67 - Fixed `GifEncoder::encode()` ignoring the speed parameter and always using the slowest speed (#2504)
68 - `.pnm` is now recognized as a file extension for the PNM format (#2559)
69
70
71 ### Version 0.25.6
72
73 Features:
74 - Improved format detection ([#2418](https://github.com/image-rs/image/pull/2418))
75 - Implement writing ICC profiles for JPEG and PNG images ([#2389](https://github.com/image-rs/image/pull/2389))
76
77 Bug fixes:
78 - JPEG encoding bugfix ([#2387](https://github.com/image-rs/image/pull/2387))
79 - Expanded ICO format detection ([#2434](https://github.com/image-rs/image/pull/2434))
80 - Fixed EXR bug with NaNs ([#2381](https://github.com/image-rs/image/pull/2381))
81 - Various documentation improvements
82
83 ### Version 0.25.5
84
85 Features:
86 - Added support for decoding 10-bit and 12-bit AVIF
87 - Initial, opt-in serde support for an enum. This may be extended to other types in the future.
88
89 Bug fixes:
90 - [Multiple bug fixes in AVIF decoding](https://github.com/image-rs/image/pull/2373)
91 - The `rayon` feature now correctly toggles the use of `rayon` when encoding AVIF. (Previously it would be either always on or always off depending on the version of the `ravif` crate in your dependency tree.)
92 - "jfif" file extension for JPEG images is now recognized
93
94 ### Version 0.25.4
95
96 Features:
97 - Much faster decoding of lossless WebP due to a variety of optimizations. Our benchmarks show 2x to 2.5x improvement.
98 - Added support for orientation metadata, so that e.g. smartphone camera images could be displayed correctly:
99 - Added `ImageDecoder::orientation()` and implemented orientation metadata extraction for JPEG, WebP and TIFF formats
100 - Added `DynamicImage::apply_orientation()` to apply the orientation to an image
101 - Added support for extracting Exif metadata from images via `ImageDecoder::exif_metadata()`, and implemented it for JPEG and WebP formats
102 - Added `ImageEncoder::set_icc_profile()` and implemented it for WebP format. Pull requests with implementations for other formats are welcome.
103 - Added `DynamicImage::fast_blur()` for a linear-time approximation of Gaussian blur, which is much faster at larger blur radii
104
105 Bug fixes:
106 - Fixed some APNG images being decoded incorrectly
107 - Fixed the iterator over animated WebP frames to return `None` instead of an error when the end of the animation is reached
108
109 ### Version 0.25.3
110
111 Yanked! This version accidentally missed a commit that should have been
112 included with the release. The `Orientation` struct should be in the
113 appropriate module instead of the top-level. This release won't be supported.
114
115 ### Version 0.25.2
116
117 Features:
118 - Added the HDR encoder to supported formats in generic write methods with the
119 `hdr` feature enabled. Supports 32-bit float RGB color only, for now.
120 - When cloning `ImageBuffer`, `DynamicImage` and `Frame` the existing buffer
121 will now be reused if possible.
122 - Added `image::ImageReader` as an alias.
123 - Implement `ImageEncoder` for `HdrEncoder`.
124
125 Structural changes
126 - Switch from `byteorder` to `byteorder-lite`, consolidating some casting
127 unsafety to `bytemuck`.
128 - Many methods on `DynamicImage` and buffers gained `#[must_use]` indications.
129
130 Bug fixes:
131 - Removed test data included in the crate archive.
132 - The WebP animation decoder stops when reaching the indicate frame count.
133 - Fixed bugs in the `bmp` decoder.
134 - Format support gated on the `exr` feature now compiles in isolation.
135
136 ### Version 0.25.1
137
138 Bug fixes:
139 - Fixed corrupt JPEG output when attempting to encode images containing an alpha
140 channel.
141 - Only accept ".ff" file extension for farbfeld images.
142 - Correct farbfeld feature flag for `ImageFormat::{reading_enabled, writing_enabled}`.
143 - Disable strict mode for JPEG decoder.
144 - Add nasm feature to optionally enable faster AVIF encoding.
145
146
147 ### Version 0.25.0
148
149 Breaking changes:
150 - Added `BufRead` + `Seek` bound on many decoders.
151 - Use `ExtendedColorType` instead of `ColorType` when encoding.
152 - Removed `ImageOutputFormat`, `GenericImageView::bounds`, and several other
153 deprecated items.
154 - Removed incremental decoding support and changed `ImageDecoder` so the trait
155 is object safe.
156 - Pixel types are now `repr(transparent)` rather than `repr(C)`.
157 - Made color_quant dependency optional.
158 - Renamed some feature flags.
159
160 Structural changes:
161 - Increased MSRV to 1.67.1
162
163 Codec changes:
164 - Switched to image-webp for WebP encoding.
165 - Switched to zune-jpeg for JPEG decoding.
166 - Made the HDR decoder produce f32 images.
167 - Removed DXT encoding and decoding support.
168
169 ### Version 0.24.9
170
171 Structural changes:
172 - Relicense to MIT OR Apache-2.0
173 - Increase MSRV 1.63.0
174
175 New features:
176 - Support limits in PNG animation decoding.
177 - Added offsets to SubImage to compensate for the now-deprecated bounds call
178 from GenericImageView.
179
180 Bug fixes:
181 - Correct limit tests for TIFF.
182 - Avoid overflow in gif::Decoder::buffer_size.
183 - Return error instead of using assertions for Avif decoder unsupported or
184 invalid bit depth.
185
186 ### Version 0.24.8
187
188 New features:
189 - Added pure-Rust lossless WebP encoding.
190 - Added `DynamicImage::new` method.
191 - Added `PngDecoder::gamma_value` method.
192 - Added `ImageFormat::{reading_enabled, writing_enabled, all}`.
193 - TGA encoder now supports RLE encoding.
194 - Add rayon parallel iterators behind an optional `rayon` feature.
195 - Support CMYK TIFF images.
196 - Implement `From<DynamicImage>` for all image types.
197
198 Bug fixes:
199 - Fix decoding pngs with invalid text chunks.
200 - Handle non-fatal error dav1d::Error::Again.
201 - Do not round floats in interpolate.
202 - PNM decoder now scales samples according to specified maximum.
203 - Fix wrong implementation of unsharpen filter.
204 - Fix `GifDecoder::with_limits` to raise an error when limits are exceeded.
205
206 ### Version 0.24.7
207
208 New features:
209 - Added `{ImageBuffer, DynamicImage}::write_with_encoder` to simplify writing
210 images with custom settings.
211 - Expose ICC profiles stored in tiff and webp files.
212 - Added option to set the background color of animated webp images.
213 - New methods for sampling and interpolation of `GenericImageView`s
214
215 Bug fixes:
216 - Fix panic on empty dxt.
217 - Fix several panics in webp decoder.
218 - Allow unknown chunks at the end of webp files.
219
220 ### Version 0.24.6
221
222 - Add support for QOI.
223 - ImageDecoders now expose ICC profiles on supported formats.
224 - Add support for BMPs without a file header.
225 - Improved AVIF encoder.
226 - WebP decoding fixes.
227
228 ### Version 0.24.5
229
230 Structural changes:
231 - Increased the minimum supported Rust version (MSRV) to 1.61.
232 - Increased the version requirement for the `tiff` crate to 0.8.0.
233 - Increased the version requirement for the `jpeg` crate to 0.3.0.
234
235 Bug fixes:
236 - The `as_rgb32f` function of `DynamicImage` is now correctly documented.
237 - Fixed a crash when decoding ICO images. Added a regression test.
238 - Fixed a panic when transforming webp images. Added a regression test.
239 - Added a check to prevent integer overflow when calculating file size for BMP
240 images. The missing check could panic in debug mode or else set an incorrect
241 file size in release mode.
242 - Upgraded the PNG image encoder to use the newer `PngEncoder::write_image`
243 instead of the deprecated `PngEncoder::encode` which did not account for byte
244 order and could result in images with incorrect colors.
245 - Fixed `InsufficientMemory` error when trying to decode a PNG image.
246 - Fix warnings and CI issues.
247 - Typos and links in the documentation have been corrected.
248
249 Performance:
250 - Added check for dynamic image dimensions before resizing. This improves
251 performance in cases where the image does not need to be resized or has
252 already been resized.
253
254 ### Version 0.24.4
255
256 New Features:
257 - Encoding for `webp` is now available with the native library. This needs to
258 be activate explicitly with the `web-encoder` feature.
259 - `exr` decoding has gained basic limit support.
260
261 Bug fixes:
262 - The `Iterator::size_hint` implementation of pixel iterators has been fixed to
263 return the current length indicated by its `ExactSizeIterator` hint.
264 - Typos and bad references in the documentation have been removed.
265
266 Performance:
267 - `ImageBuffer::get_pixel{,_mut}` is now marked inline.
268 - `resize` now short-circuits when image dimensions are unchanged.
269
270 ### Version 0.24.3
271
272 New Features:
273 - `TiffDecoder` now supports setting resource limits.
274
275 Bug fixes:
276 - Fix compile issues on little endian systems.
277 - Various panics discovered by fuzzing.
278
279 ### Version 0.24.2
280
281 Structural changes:
282 - CI now runs `cargo-deny`, checking dependent crates to an OSS license list
283 and against RUSTSEC advisories.
284
285 New Features:
286 - The WebP decoder recognizes and decodes images with `VP8X` header.
287 - The DDS decoder recognizes and decodes images with `DX10` headers.
288
289 Bug fixes:
290 - Calling `DynamicImage`/`ImageBuffer`'s methods `write_to` and `save` will now
291 work properly even if the backing container is larger than the image layout
292 requires. Only the relevant slice of pixel data is passed to the encoder.
293 - Fixed a OOM-panic caused by malformed images in the `gif` decoder.
294
295 ### Version 0.24.1
296
297 Bug Fixes:
298 - ImageBuffer::get_pixel_checked would sometimes return the incorrect pixel.
299 - PNG encoding would sometimes not recognize unsupported color.
300
301 ### Version 0.24.0
302
303 Breaking changes
304
305 Structural changes:
306 - Minimum Rust version is now `1.56` and may change in minor versions until
307 further notice. It is now tracked in the library's `Cargo.toml`, instead, by
308 the standard `[package.rust-version]` field. Note: this applies _to the
309 library itself_. You may need different version resolutions for dependencies
310 when using a non-stable version of Rust.
311 - The `math::utils::{nq, utils}` modules have been removed. These are better
312 served through the `color_quant` crate and the standard library respectively.
313 - All codecs are now available through `image::codecs`, no longer top-level.
314 - `ExtendedColorType` and `DynamicImage` have been made `#[non_exhaustive]`,
315 providing more methods instead of exhaustive matching.
316 - Reading images through the generic `io::Reader`, as well as generic
317 convenience interfaces, now requires the underlying reader to be `BufRead +
318 Seek`. This allows more efficient support more formats. Similarly, writing
319 now requires writers to be `Write + Seek`.
320 - The `Bgra*` variants of buffers, which were only half-supported, have been
321 removed. The owning buffer types `ImageBuffer` and `DynamicImage`
322 fundamentally already make a choice in supported pixel representations. This
323 allows for more consistent internal behavior. Callers are expected to convert
324 formats when using those buffers, which they are required to do in any case
325 already, and which is routinely performed by decoders.
326
327 Trait reworks:
328 - The `Pixel` trait is no longer implemented quite as liberally for structs
329 defined in the crate. Instead, it is now restricted to a set of known channel
330 which ensures accuracy in computations involving those channels.
331 - The `ImageDecoderExt` trait has been renamed to `ImageDecoderRect`, according
332 to its actual functionality.
333 - The `Pixel` trait and its `Subpixel` field no longer require (or provide) a
334 `'static` lifetime bound.
335 - The `Pixel` trait no longer requires specifying an associated, constant
336 `ColorType`. This was of little relevance to computation but made it much
337 harder to implement and extend correctly. Instead, the _private_
338 `PixelWithColorType` extension is added for interfaces that require a
339 properly known variant.
340 - Reworked how `SubImage` interacts with the `GenericImage` trait. It is now a
341 default implementation. Note that `SubImage` now has _inherent_ methods that
342 avoid double-indirection, the trait's method will no longer avoid this.
343 - The `Primitive` trait now requires implementations to provide a minimum and
344 maximum logical bound for the purpose of converting to other primitive
345 representations.
346
347 Additions
348
349 Image formats:
350 - Reading lossless WebP is now supported.
351 - The OpenEXR format is now supported.
352 - The `jpeg` decoder has been upgraded to Lossless JPEG.
353 - The `AvifEncoder` now correctly handles alpha-less images. Some additional
354 color formats are converted to RGBA as well.
355 - The `Bmp` codec now decodes more valid images. It can decode a raw image
356 without performing the palette mapping. It provides a method to access the
357 palette. The encoder provides the inverse capabilities.
358 - `Tiff` is now an output format.
359
360 Buffers and Operations:
361 - The channel / primitive type `f32` is now supported. Currently only the
362 OpenEXR codec makes full use of it but this is expected to change.
363 - `ImageBuffer::{get_pixel_checked, get_pixel_mut_checked}` provide panic-free
364 access to pixels and channels by returning `Option<&P>` and `Option<&mut P>`.
365 - `ImageBuffer::write_to` has been added, encoding the buffer to a writer. This
366 method already existed on `DynamicImage`.
367 - `DynamicImage` now implements `From<_>` for all supported buffer types.
368 - `DynamicImage` now implements `Default`, an empty `Rgba8` image.
369 - `imageops::overlay` now takes coordinates as `i64`.
370
371 Limits:
372 - Added `Limits` and `LimitSupport`, utilized in `io::Reader`. These can be
373 configured for rudimentary protection against resource exhaustion (images
374 pretending to require a very large buffer). These types are not yet
375 exhaustive by design, and more and stricter limits may be added in the
376 future.
377 - Encoders that do provide inherent support for limits, or reserve a
378 significant amount of internal memory, are urged to implement the
379 `set_limits` extension to `ImageDecoder`. Some strict limit are opt-in, which
380 may cause decoding to fail if not supported.
381
382 Miscellaneous:
383 - `PNMSubtype` has been renamed to `PnmSubtype`, by Rust's naming scheme.
384 - Several incorrectly capitalized `PNM*` aliases have been removed.
385 - Several `enum` types that had previously used a hidden variant now use the
386 official `#[non_exhaustive]` attribute instead.
387
388 ### Version 0.23.14
389
390 - Unified gif blending in different decode methods, fixing out-of-bounds checks
391 in a number of weirdly positioned frames.
392 - Hardened TGA decoder against a number of malicious inputs.
393 - Fix forward incompatible usage of the panic macro.
394 - Fix load_rect for gif reaching `unreachable!()` code.
395
396 - Added `ExtendedColorType::A8`.
397 - Allow TGA to load alpha-only images.
398 - Optimized load_rect to avoid unnecessary seeks.
399
400 ### Version 0.23.13
401
402 - Fix an inconsistency in supported formats of different methods for encoding
403 an image.
404 - Fix `thumbnail` choosing an empty image. It now always prefer non-empty image
405 dimensions.
406 - Fix integer overflow in calculating requires bytes for decoded image buffers
407 for farbfeld, hdr, and pnm decoders. These will now error early.
408 - Fix a panic decoding certain `jpeg` image without frames or meta data.
409 - Optimized the `jpeg` encoder.
410 - Optimized `GenericImage::copy_from` default impl in various cases.
411
412 - Add `avif` decoders. You must enable it explicitly and it is not covered by
413 our usual MSRV policy of Rust 1.34. Instead, only latest stable is supported.
414 - Add `ImageFormat::{can_read, can_write}`
415 - Add `Frame::buffer_mut`
416 - Add speed and quality options on `avif` encoder.
417 - Add speed parameter to `gif` encoder.
418 - Expose control over sequence repeat to the `gif` encoder.
419 - Add `{contrast,brighten,huerotate}_in_place` functions in imageproc.
420
421 - Relax `Default` impl of `ImageBuffer`, removing the bound on the color type.
422 - Derive Debug, Hash, PartialEq, Eq for DynamicImage
423
424 ### Version 0.23.12
425
426 - Fix a soundness issue affecting the impls of `Pixel::from_slice_mut`. This
427 would previously reborrow the mutable input reference as a shared one but
428 then proceed to construct the mutable result reference from it. While UB
429 according to Rust's memory model, we're fairly certain that no miscompilation
430 can happen with the LLVM codegen in practice.
431 See 5cbe1e6767d11aff3f14c7ad69a06b04e8d583c7 for more details.
432 - Fix `imageops::blur` panicking when `sigma = 0.0`. It now defaults to `1.0`
433 as all negative values.
434 - Fix re-exporting `png::{CompressionType, FilterType}` to maintain SemVer
435 compatibility with the `0.23` releases.
436
437 - Add `ImageFormat::from_extension`
438 - Add copyless DynamicImage to byte slice/vec conversion.
439 - Add bit-depth specific `into_` and `to_` DynamicImage conversion methods.
440
441
442 ### Version 0.23.11
443
444 - The `NeuQuant` implementation is now supplied by `color_quant`. Use of the
445 type defined by this library is discouraged.
446 - The `jpeg` decoder can now downscale images that are decoded by 1,2,4,8.
447 - Optimized the jpeg encoding ~5-15%.
448 - Deprecated the `clamp` function. Use `num-traits` instead.
449 - The ICO decoder now accepts an empty mask.
450 - Fixed an overflow in ICO mask decoding potentially leading to panic.
451 - Added `ImageOutputFormat` for `AVIF`
452 - Updated `tiff` to `0.6` with lzw performance improvements.
453
454 ### Version 0.23.10
455
456 - Added AVIF encoding capabilities using the `ravif` crate. Please note that
457 the feature targets the latest stable compiler and is not enabled by default.
458 - Added `ImageBuffer::as_raw` to inspect the underlying container.
459 - Updated `gif` to `0.11` with large performance improvements.
460
461 ### Version 0.23.9
462
463 - Introduced correctly capitalized aliases for some scream case types
464 - Introduced `imageops::{vertical_gradient, horizontal_gradient}` for writing
465 simple color gradients into an image.
466 - Sped up methods iterating over `Pixels`, `PixelsMut`, etc. by using exact
467 chunks internally. This should auto-vectorize `ImageBuffer::from_pixel`.
468 - Adjusted `Clone` impls of iterators to not require a bound on the pixel.
469 - Add `Debug` impls for iterators where the pixel's channel implements it.
470 - Add comparison impls for `FilterType`
471
472 ### Version 0.23.8
473
474 - `flat::Error` now implements the standard `Error` trait
475 - The type parameter of `Map` has been relaxed to `?Sized`
476 - Added the `imageops::tile` function that repeats one image across another
477
478 ### Version 0.23.7
479
480 - Iterators over immutable pixels of `ImageBuffer` can now be cloned
481 - Added a `tga` encoder
482 - Added `ColorMap::lookup`, an optional reversal of the map
483 - The `EncodableLayout` trait is now exported
484
485 ### Version 0.23.6
486
487 - Added `png::ApngDecoder`, an adapter decoding the animation in an APNG.
488 - Fixed a bug in `jpeg` encoding that would darken output colors.
489 - Added a utility constructor `FlatSamples::with_monocolor`.
490 - Added `ImageBuffer::as_flat_samples_mut` which is a mutable variant of the
491 existing ffi-helper `ImageBuffer::as_flat_samples`.
492
493 ### Version 0.23.5
494
495 - The `png` encoder now allows configuring compression and filter type. The
496 output is not part of stability guarantees, see its documentation.
497 - The `jpeg` encoder now accepts any implementor of `GenericImageView`. This
498 allows images that are only partially present in memory to be encoded.
499 - `ImageBuffer` now derives `Hash`, `PartialEq`, `Eq`.
500 - The `Pixels`/`PixelsMut` iterator no longer yields out-of-bounds pixels when
501 the underlying buffer is larger than required.
502 - The `pbm` decoder correctly decodes ascii data again, fixing a regression
503 where it would use the sample value `1` as white instead of `255`.
504 - Fix encoding of RGBA data in `gif` frames.
505 - Constructing a `Rows`/`RowsMut` iterator no longer panics when the image has
506 a width or height of `0`.
507
508 ### Version 0.23.4
509
510 - Improved the performance of decoding animated gifs
511 - Added `crop_imm` which functions like `crop` but on a shared reference
512 - The gif `DisposalMethod::Any` is treated as `Keep`, consistent with browsers
513 - Most errors no longer allocate a string, instead implement Display.
514 - Add some implementations of `Error::source`
515
516 ### Version 0.23.3
517
518 - Added `ColorType::has_alpha` to facilitate lossless conversion
519 - Recognize extended WebP formats for decoding
520 - Added decoding and encoding for the `farbfeld` format
521 - Export named iterator types created from various `ImageBuffer` methods
522 - Error in jpeg encoder for images larger than 65536 pixels, fixes panic
523
524 ### Version 0.23.2
525
526 - The dependency on `jpeg-decoder` now reflects minimum requirements.
527
528 ### Version 0.23.1
529
530 - Fix cmyk_to_rgb (jpeg) causing off by one rounding errors.
531 - A number of performance improvements for jpeg (encode and decode), bmp, vp8
532 - Added more details to errors for many formats
533
534 ### Version 0.23.0
535
536 This major release intends to improve the interface with regards to handling of
537 color format data and errors for both decoding and encoding. This necessitated
538 many breaking changes anyways so it was used to improve the compliance to the
539 interface guidelines such as outstanding renaming.
540
541 It is not yet perfect with regards to color spaces but it was designed mainly
542 as an improvement over the current interface with regards to in-memory color
543 formats, first. We'll get to color spaces in a later major version.
544
545 - Heavily reworked `ColorType`:
546 - This type is now used for denoting formats for which we support operations
547 on buffers in these memory representations. Particularly, all channels in
548 pixel types are assumed to be an integer number of bytes (In terms of the
549 Rust type system, these are `Sized` and one can crate slices of channel
550 values).
551 - An `ExtendedColorType` is used to express more generic color formats for
552 which the library has limited support but can be converted/scaled/mapped
553 into a `ColorType` buffer. This operation might be fallible but, for
554 example, includes sources with 1/2/4-bit components.
555 - Both types are non-exhaustive to add more formats in a minor release.
556 - A work-in-progress (#1085) will further separate the color model from the
557 specific channel instantiation, e.g. both `8-bit RGB` and `16-bit BGR`
558 are instantiations of `RGB` color model.
559 - Heavily rework `ImageError`:
560 - The top-level enum type now serves to differentiate cause with multiple
561 opaque representations for the actual error. These are no longer simple
562 Strings but contains useful types. Third-party decoders that have no
563 variant in `ImageFormat` have also been considered.
564 - Support for `Error::source` that can be downcast to an error from a
565 matching version of the underlying decoders. Note that the version is not
566 part of the stable interface guarantees, this should not be relied upon
567 for correctness and only be used as an optimization.
568 - Added image format indications to errors.
569 - The error values produced by decoder will be upgraded incrementally. See
570 something that still produces plain old String messages? Feel free to
571 send a PR.
572 - Reworked the `ImageDecoder` trait:
573 - `read_image` takes an output buffer argument instead of allocating all
574 memory on its own.
575 - The return type of `dimensions` now aligns with `GenericImage` sizes.
576 - The `colortype` method was renamed to `color_type` for conformity.
577 - The enums `ColorType`, `DynamicImage`, `imageops::FilterType`, `ImageFormat`
578 no longer re-export all of their variants in the top-level of the crate. This
579 removes the growing pollution in the documentation and usage. You can still
580 insert the equivalent statement on your own:
581 `use image::ImageFormat::{self, *};`
582 - The result of `encode` operations is now uniformly an `ImageResult<()>`.
583 - Removed public converters from some `tiff`, `png`, `gif`, `jpeg` types,
584 mainly such as error conversion. This allows upgrading the dependency across
585 major versions without a major release in `image` itself.
586 - On that note, the public interface of `gif` encoder no longer takes a
587 `gif::Frame` but rather deals with `image::Frame` only. If you require to
588 specify the disposal method, transparency, etc. then you may want to wait
589 with upgrading but (see next change).
590 - The `gif` encoder now errors on invalid dimensions or unsupported color
591 formats. It would previously silently reinterpret bytes as RGB/RGBA.
592 - The capitalization of `ImageFormat` and other enum variants has been
593 adjusted to adhere to the API guidelines. These variants are now spelled
594 `Gif`, `Png`, etc. The same change has been made to the name of types such as
595 `HDRDecoder`.
596 - The `Progress` type has finally received public accessor method. Strange that
597 no one reported them missing.
598 - Introduced `PixelDensity` and `PixelDensityUnit` to store DPI information in
599 formats that support encoding this form of meta data (e.g. in `jpeg`).
600
601 ### Version 0.22.5
602
603 - Added `GenericImage::copy_within`, specialized for `ImageBuffer`
604 - Fixed decoding of interlaced `gif` files
605 - Prepare for future compatibility of array `IntoIterator` in example code
606
607 ### Version 0.22.4
608
609 - Added in-place variants for flip and rotate operations.
610 - The bmp encoder now checks if dimensions are valid for the format. It would
611 previously write a subset or panic.
612 - Removed deprecated implementations of `Error::description`
613 - Added `DynamicImage::into_*` which convert without an additional allocation.
614 - The PNG encoder errors on unsupported color types where it had previously
615 silently swapped color channels.
616 - Enabled saving images as `gif` with `save_buffer`.
617
618 ### Version 0.22.3
619
620 - Added a new module `io` containing a configurable `Reader`. It can replace
621 the bunch of free functions: `image::{load_*, open, image_dimensions}` while
622 enabling new combinations such as `open` but with format deduced from content
623 instead of file path.
624 - Fixed `const_err` lint in the macro expanded implementations of `Pixel`. This
625 can only affect your crate if `image` is used as a path dependency.
626
627 ### Version 0.22.2
628
629 - Undeprecate `unsafe` trait accessors. Further evaluation showed that their
630 deprecation should be delayed until trait `impl` specialization is available.
631 - Fixed magic bytes used to detect `tiff` images.
632 - Added `DynamicImage::from_decoder`.
633 - Fixed a bug in the `PNGReader` that caused an infinite loop.
634 - Added `ColorType::{bits_per_pixel, num_components}`.
635 - Added `ImageFormat::from_path`, same format deduction as the `open` method.
636 - Fixed a panic in the gif decoder.
637 - Aligned background color handling of `gif` to web browser implementations.
638 - Fixed handling of partial frames in animated `gif`.
639 - Removed unused direct `lzw` dependency, an indirect dependency in `tiff`.
640
641 ### Version 0.22.1
642
643 - Fixed build without no features enabled
644
645 ### Version 0.22
646
647 - The required Rust version is now `1.34.2`.
648 - Note the website and blog: [image-rs.org][1] and [blog.image-rs.org][2]
649 - `PixelMut` now only on `ImageBuffer` and removed from `GenericImage`
650 interface. Prefer iterating manually in the generic case.
651 - Replaced an unsafe interface in the hdr decoder with a safe variant.
652 - Support loading 2-bit BMP images
653 - Add method to save an `ImageBuffer`/`DynamicImage` with specified format
654 - Update tiff to `0.3` with a writer
655 - Update png to `0.15`, fixes reading of interlaced sub-byte pixels
656 - Always use custom struct for `ImageDecoder::Reader`
657 - Added `apply_without_alpha` and `map_without_alpha` to `Pixel` trait
658 - Pixel information now with associated constants instead of static methods
659 - Changed color structs to tuple types with single component. Improves
660 ergonomics of destructuring assignment and construction.
661 - Add lifetime parameter on `ImageDecoder` trait.
662 - Remove unnecessary `'static` bounds on affine operations
663 - Add function to retrieve image dimensions without loading full image
664 - Allow different image types in overlay and replace
665 - Iterators over rows of `ImageBuffer`, mutable variants
666
667 [1]: https://www.image-rs.org
668 [2]: https://blog.image-rs.org
669
670 ### Version 0.21.2
671
672 - Fixed a variety of crashes and opaque errors in webp
673 - Updated the png limits to be less restrictive
674 - Reworked even more `unsafe` operations into safe alternatives
675 - Derived Debug on FilterType and Deref on Pixel
676 - Removed a restriction on DXT to always require power of two dimensions
677 - Change the encoding of RGBA in bmp using bitfields
678 - Corrected various urls
679
680 ### Version 0.21.1
681
682 - A fairly important bugfix backport
683 - Fixed a potentially memory safety issue in the hdr and tiff decoders, see #885
684 - See [the full advisory](docs/2019-04-23-memory-unsafety.md) for an analysis
685 - Fixes `ImageBuffer` index calculation for very, very large images
686 - Fix some crashes while parsing specific incomplete pnm images
687 - Added comprehensive fuzzing for the pam image types
688
689 ### Version 0.21
690
691 - Updated README to use `GenericImageView`
692 - Removed outdated version number from CHANGES
693 - Compiles now with wasm-unknown-emscripten target
694 - Restructured `ImageDecoder` trait
695 - Updated README with a more colorful example for the Julia fractal
696 - Use Rust 1.24.1 as minimum supported version
697 - Support for loading GIF frames one at a time with `animation::Frames`
698 - The TGA decoder now recognizes 32 bpp as RGBA(8)
699 - Fixed `to_bgra` document comment
700 - Added release test script
701 - Removed unsafe code blocks several places
702 - Fixed overlay overflow bug issues with documented proofs
703
704 ### Version 0.20
705
706 - Clippy lint pass
707 - Updated num-rational dependency
708 - Added BGRA and BGR color types
709 - Improved performance of image resizing
710 - Improved PBM decoding
711 - PNM P4 decoding now returns bits instead of bytes
712 - Fixed move of overlapping buffers in BMP decoder
713 - Fixed some document comments
714 - `GenericImage` and `GenericImageView` is now object-safe
715 - Moved TIFF code to its own library
716 - Fixed README examples
717 - Fixed ordering of interpolated parameters in TIFF decode error string
718 - Thumbnail now handles upscaling
719 - GIF encoding for multiple frames
720 - Improved subimages API
721 - Cargo fmt fixes
722
723 ### Version 0.19
724
725 - Fixed panic when blending with alpha zero.
726 - Made `save` consistent.
727 - Consistent size calculation.
728 - Fixed bug in `apply_with_alpha`.
729 - Implemented `TGADecoder::read_scanline`.
730 - Use deprecated attribute for `pixels_mut`.
731 - Fixed bug in JPEG grayscale encoding.
732 - Fixed multi image TIFF.
733 - PNM encoder.
734 - Added `#[derive(Hash)]` for `ColorType`.
735 - Use `num-derive` for `#[derive(FromPrimitive)]`.
736 - Added `into_frames` implementation for GIF.
737 - Made rayon an optional dependency.
738 - Fixed issue where resizing image did not give exact width/height.
739 - Improved downscale.
740 - Added a way to expose options when saving files.
741 - Fixed some compiler warnings.
742 - Switched to lzw crate instead of using built-in version.
743 - Added `ExactSizeIterator` implementations to buffer structs.
744 - Added `resize_to_fill` method.
745 - DXT encoding support.
746 - Applied clippy suggestions.
747
748 ### Version 0.4
749 - Various improvements.
750 - Additional supported image formats (BMP and ICO).
751 - GIF and PNG codec moved into separate crates.
752
753 ### Version 0.3
754 - Replace `std::old_io` with `std::io`.
755
756 ### Version 0.2
757 - Support for interlaced PNG images.
758 - Writing support for GIF images (full color and paletted).
759 - Color quantizer that converts 32bit images to paletted including the alpha channel.
760 - Initial support for reading TGA images.
761 - Reading support for TIFF images (packbits and FAX compression not supported).
762 - Various bug fixes and improvements.
763
764 ### Version 0.1
765 - Initial release
766 - Basic reading support for png, jpeg, gif, ppm and webp.
767 - Basic writing support for png and jpeg.
768 - A collection of basic imaging processing function like `blur` or `invert`