pict-rs/releases/0.5.6.md

2.7 KiB

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

Changes

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.

# pict-rs.toml
# values are in MiB
[media.magick]
memory = 256
map = 512
disk = 1024
# environment variables
# values are in MiB
PICTRS__MEDIA__MAGICK__MEMORY=256
PICTRS__MEDIA__MAGICK__MAP=512
PICTRS__MEDIA__MAGICK__DISK=1024
# commandline
# values are in MiB
pict-rs run \
    --media-magick-memory 256 \
    --media-magick-map 512 \
    --media-magick-disk 1024

Metrics Descriptions

pict-rs now has descriptions for each of the metrics it emits. They're all pretty short for now, but can be expanded in the future if there's confusion. This is only useful when pict-rs is configured to host a prometheus scrape endpoint.

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.