• v0.5.7 40bb58d603

    pict-rs 0.5.7
    All checks were successful
    / check (aarch64-unknown-linux-musl) (push) Successful in 2m59s
    / check (x86_64-unknown-linux-musl) (push) Successful in 1m52s
    / check (armv7-unknown-linux-musleabihf) (push) Successful in 3m2s
    / clippy (push) Successful in 2m10s
    / tests (push) Successful in 2m19s
    / build (map[artifact:linux-arm64v8 platform:linux/arm64 target:aarch64-unknown-linux-musl]) (push) Successful in 3m48s
    / publish-docker (push) Successful in 15s
    / publish-crate (push) Successful in 1m51s
    / build (map[artifact:linux-amd64 platform:linux/amd64 target:x86_64-unknown-linux-musl]) (push) Successful in 3m45s
    / build (map[artifact:linux-arm32v7 platform:linux/arm/v7 target:armv7-unknown-linux-musleabihf]) (push) Successful in 3m53s
    / publish-forgejo (push) Successful in 17s
    Stable

    asonix released this 2024-03-03 17:35:32 +00:00 | 58 commits to main since this release

    pict-rs 0.5.7

    Overview

    pict-rs 0.5.7 adds support for generating blurhashes from images and includes a couple unrelated
    fixes and tweaks.

    Features

    Changes

    Fixes

    Upgrade Notes

    There is a small repo format migration between 0.5.6 and 0.5.7. For sled it's simply opening a new
    tree, for postgres it involves adding a new column to the hashes table. These changes will
    automatically apply when launching pict-rs 0.5.7. Upgrading should be as simple as pulling a new
    version of pict-rs.

    Descriptions

    Blurhash Endpoint

    A new endpoint at /image/blurhash has been added for generating blurhashes from uploaded media. A
    blurhash is a short string that encodes a few notable color values from an image that can be
    reconstructed into a blurred approximation of the original image. Notably, blurhashes are used by
    Mastodon to act as placeholders for sensitive media. For more information about blurhashes, see
    blurha.sh.

    This endpoint is powered by my new blurhash encoding library,
    blurhash-update.

    On success, the blurhash endpoint returns the following JSON.

    {
        "msg": "ok",
        "blurhash": "LGF5]+Yk^6#M@-5c,1J5@[or[Q6."
    }
    

    pict-rs does not provide a blurhash decoding mechanism (it would defeat the purpose of blurhashes to
    do so).

    File Path Changes

    pict-rs has dropped its dependency on my storage-path-generator library in favor of using UUIDs to
    create unique file paths for uploaded media. This means that newly uploaded media will be stored in
    a different directory structure, and with different filenames. The purpose of this is to reduce
    database use by removing the need to synchronize the current path state.

    pict-rs 0.5.7 also adds file extensions back to file paths, since they are now somewhat-publicly
    visible (when using the public_endpoint configuration with object storage).

    Neither of these changes affect previously uploaded media.

    Performance Improvements

    pict-rs 0.5.7 now buffers media in memory less frequently, opting to stream bytes directly from
    sources to sinks. This should improve general memory use, as well as decrease time pict-rs would
    spend waiting to aggregate bytes.

    pict-rs also no longer requires bytes be present in contiguous buffers, avoiding large allocations
    and reducing memcpys.

    More Consistent Errors

    pict-rs 0.5 introduced machine-readable error codes that returned alongside error messages, but
    there were a couple locations in pict-rs that failed to include them. pict-rs 0.5.7 resolves this,
    ensuring all error paths properly return codes.

    APNG Detection

    pict-rs 0.5.7 fixes the imagemagick delegate policy for ffmpeg, which allows for properly detecting
    certain media, notably APNG files. pict-rs should once again be able to properly handle uploaded
    APNGs.

    Downloads