Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 28 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,26 +42,37 @@ image format encoders and decoders.

<!--- NOTE: Make sure to keep this table in sync with the one in src/lib.rs -->

| Format | Decoding | Encoding |
| -------- | ----------------------------------------- | --------------------------------------- |
| AVIF | Yes \* | Yes (lossy only) |
| BMP | Yes | Yes |
| DDS | Yes | --- |
| Farbfeld | Yes | Yes |
| GIF | Yes | Yes |
| HDR | Yes | Yes |
| ICO | Yes | Yes |
| JPEG | Yes | Yes |
| EXR | Yes | Yes |
| PNG | Yes | Yes |
| PNM | Yes | Yes |
| QOI | Yes | Yes |
| TGA | Yes | Yes |
| TIFF | Yes | Yes |
| WebP | Yes | Yes (lossless only) |
| Format | Decoding | Encoding | Feature |
| -------- | ----------------------------------------- | --------------------------------------- | ------- |
| AVIF | Yes \* | Yes (lossy only) | `avif` |
| BMP | Yes | Yes | `bmp` |
| DDS | Yes | --- | `dds` |
| Farbfeld | Yes | Yes | `ff` |
| GIF | Yes | Yes | `gif` |
| HDR | Yes | Yes | `hdr` |
| ICO | Yes | Yes | `ico` |
| JPEG | Yes | Yes | `jpeg` |
| EXR | Yes | Yes | `exr` |
| PNG | Yes | Yes | `png` |
| PNM | Yes | Yes | `pnm` |
| QOI | Yes | Yes | `qoi` |
| TGA | Yes | Yes | `tga` |
| TIFF | Yes | Yes | `tiff` |
| WebP | Yes | Yes (lossless only) | `webp` |

- \* Requires the `avif-native` feature, uses the libdav1d C library.

Other feature flags for the `image` crate:

| Feature | Description
| ------------- | -----------
| `rayon` | Enables multi-threading with rayon context in some dependencies
| `nasm` | Enables the build-time use of `nasm` for `ravif`, requires `nasm` installed
| `color_quant` | Includes `color_quant` as an implementation of `imageops::ColorMap`
| `avif-native` | Enables non-Rust dependencies of `avif` (`mp4parse` and `dav1d`)
| `serde` | Enables `serde` integration for various structs and options
| `benchmarks` | This feature is used (internally) for benchmark dependencies

## Image Types

This crate provides a number of different types for representing images.
Expand Down
3 changes: 3 additions & 0 deletions src/io/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ pub trait ImageDecoder {
/// you call [`Limits::check_dimensions`] to check the `max_image_width` and
/// `max_image_height` limits.
///
/// **Note**: By default, _no_ limits are defined. This may be changed in future major version
/// increases.
///
/// [`Limits`]: ./io/struct.Limits.html
/// [`Limits::check_support`]: ./io/struct.Limits.html#method.check_support
/// [`Limits::check_dimensions`]: ./io/struct.Limits.html#method.check_dimensions
Expand Down
4 changes: 4 additions & 0 deletions src/io/limits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ pub struct Limits {
pub max_alloc: Option<u64>,
}

/// Add some reasonable limits.
///
/// **Note**: This is not equivalent to _not_ adding limits. This may be changed in future major
/// version increases.
impl Default for Limits {
fn default() -> Limits {
Limits {
Expand Down
Loading