2
0
Fork 0
mirror of https://git.asonix.dog/asonix/pict-rs synced 2024-12-23 03:41:23 +00:00
pict-rs/releases/0.5.6.md
asonix 4a7a51d147 Add more imagemagick security configuration
Remove default security policy, since it is overridden anyway
Update default value for max_area
Inherit animation frame count configuration for list-length
Add release document
2024-02-05 14:30:01 -06:00

76 lines
2.3 KiB
Markdown

# pict-rs 0.5.6
## Overview
pict-rs 0.5.6 adds more configuration for imagemagick security policies and updates the default
value for `max_area`
### Features
- [More Imagemagick Configuration](#more-imagemagick-configuration)
### Changes
- [Imagemagick Area Defaults](#imagemagick-area-defaults)
- [Imagemagick Frame Configuration](#imagemagick-frame-configuration)
## Upgrade Notes
There's no significant changes from 0.5.5, so upgrading should be as simple as pulling a new version
of pict-rs.
## Descriptions
### More Imagemagick Configuration
Three new configuration values have been added to the imagemagick security configuration for
pict-rs: `memory`, `map`, and `disk`. These options describe sizes for three tiers of storage that
imagemagick is allowed to use when processing media. The first is `memory`, this is a simple value
that represents how much RAM imagemagick is allowed to use to store image pixels. If this size is
exceeded, it will start using the next tier of storage for image pixels, which is `map`. `map`
represents space on disk that's mapped into RAM for quicker access. Since it's disk-backed, it can
be larger than `memory`. Finally, if `map` is exceeded, imagemagick will start using the `disk` for
storing pixels without mapping into memory. If the `disk` size is exceeded, media processing is
aborted.
The configuration for these values can be set via the pict-rs.toml file, via environment variables,
or via the commandline.
```toml
# pict-rs.toml
# values are in MiB
[media.magick]
memory = 256
map = 512
disk = 1024
```
```bash
# environment variables
# values are in MiB
PICTRS__MEDIA__MAGICK__MEMORY=256
PICTRS__MEDIA__MAGICK__MAP=512
PICTRS__MEDIA__MAGICK__DISK=1024
```
```bash
# commandline
# values are in MiB
pict-rs run \
--media-magick-memory 256 \
--media-magick-map 512 \
--media-magick-disk 1024
```
### Imagemagick Area Defaults
The default value for `max_area` has been decreased from 40 million to 20 thousand. The reason for
this is it doesn't impose a hard limit on the area of uploaded images, it instead imposes a limit on
how much of an image can be held in memory at a time, with the rest of the image residing on disk.
### Imagemagick Frame Configuration
Imagemagick now inherits pict-rs' animation `max_frame_count` value to set it's maximum
`list-length`, which should allow longer animations to be configured.