Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package frei0r-plugins for openSUSE:Factory checked in at 2026-11-13 18:37:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/frei0r-plugins (Old) and /work/SRC/openSUSE:Factory/.frei0r-plugins.new.1251 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "frei0r-plugins" Fri Nov 13 18:37:22 2026 rev:30 rq:1397351 version:3.7.1 Changes: -------- --- /work/SRC/openSUSE:Factory/frei0r-plugins/frei0r-plugins.changes 2026-11-06 20:42:50.053873023 +0100 +++ /work/SRC/openSUSE:Factory/.frei0r-plugins.new.1251/frei0r-plugins.changes 2026-11-13 18:41:19.340511925 +0100 @@ -1,0 +2,9 @@ +Fri Nov 13 13:31:10 UTC 2026 - Bjørn Lie <[email protected]> + +- Update to version 3.7.1: + * Fix(build): move WASM packager out of .github + * Fix live demo menu navigation returning a 404 + * Fix(harris0r): stabilize delay conversion with x87 precision + * Fix: big-endian bundle contract and Cairo input mutation + +------------------------------------------------------------------- Old: ---- frei0r-plugins-3.7.0.tar.gz New: ---- frei0r-plugins-3.7.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ frei0r-plugins.spec ++++++ --- /var/tmp/diff_new_pack.2w1a5F/_old 2026-11-13 18:41:20.311553009 +0100 +++ /var/tmp/diff_new_pack.2w1a5F/_new 2026-11-13 18:41:20.313553094 +0100 @@ -17,7 +17,7 @@ Name: frei0r-plugins -Version: 3.7.0 +Version: 3.7.1 Release: 0 Summary: Collection of video sources and filters plugins # Upstream says 2.0+ but quite few of their plugins are GPL-3.0+ ++++++ frei0r-plugins-3.7.0.tar.gz -> frei0r-plugins-3.7.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/.github/scripts/package-wasm-release.sh new/frei0r-3.7.1/.github/scripts/package-wasm-release.sh --- old/frei0r-3.7.0/.github/scripts/package-wasm-release.sh 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/.github/scripts/package-wasm-release.sh 1970-01-01 01:00:00.000000000 +0100 @@ -1,110 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuo pipefail - -fatal() { - printf 'error: %s\n' "$1" >&2 - exit 1 -} - -platform=${1:?platform required} -version=${2:?version required} -sdk_version=${3:?SDK version required} -build_dir=${4:?build directory required} -output_dir=${5:?output directory required} - -[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || - fatal "version must be SemVer without a leading v" -[[ "$sdk_version" =~ ^[0-9A-Za-z._+-]+$ ]] || - fatal "SDK version contains unsupported characters" -case "$platform" in - wasi|emscripten) ;; - *) fatal "platform must be wasi or emscripten" ;; -esac - -command -v sha256sum >/dev/null || fatal "sha256sum is required" -command -v tar >/dev/null || fatal "tar is required" - -script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P) -source_dir=$(cd "$script_dir/../.." && pwd -P) -build_dir=$(cd "$build_dir" && pwd -P) -mkdir -p "$output_dir" -output_dir=$(cd "$output_dir" && pwd -P) - -package_name="frei0r-${version}_${platform}" -package_dir="$output_dir/$package_name" -archive="$output_dir/${package_name}.tar.gz" -[[ ! -e "$package_dir" && ! -e "$archive" ]] || - fatal "package output already exists: $package_name" - -mkdir -p "$package_dir/contracts" "$package_dir/include/frei0r" \ - "$package_dir/lib" -install -m 0644 "$source_dir/include/frei0r.h" \ - "$package_dir/include/frei0r.h" -install -m 0644 "$source_dir/include/frei0r/bundle.h" \ - "$package_dir/include/frei0r/bundle.h" -install -m 0644 "$build_dir/libfrei0r-bundle-static.a" \ - "$package_dir/lib/libfrei0r-bundle-static.a" - -case "$platform" in - wasi) - sdk_name=wasi-sdk - target=wasi-preview1 - runtime=node-wasi-preview1 - contract_files=( - bundle-registry-wasi.wasm - bundle-wasi-consumer.wasm - ) - for file in "${contract_files[@]}"; do - install -m 0644 "$build_dir/test/$file" "$package_dir/contracts/$file" - done - ;; - emscripten) - sdk_name=emsdk - target=emscripten - runtime=node - contract_files=( - bundle-registry-emscripten.js - bundle-registry-emscripten.wasm - bundle-emscripten-consumer.js - bundle-emscripten-consumer.wasm - ) - for file in "${contract_files[@]}"; do - install -m 0644 "$build_dir/test/$file" "$package_dir/contracts/$file" - done - ;; -esac - -{ - printf '{\n' - printf ' "schema_version": 1,\n' - printf ' "name": "frei0r-bundle",\n' - printf ' "version": "%s",\n' "$version" - printf ' "target": "%s",\n' "$target" - printf ' "bundle_profile": "core",\n' - printf ' "wasm_profile": "baseline-scalar-single-threaded",\n' - printf ' "sdk": {"name": "%s", "version": "%s"},\n' \ - "$sdk_name" "$sdk_version" - printf ' "runtime_test": "%s",\n' "$runtime" - printf ' "application_contract": {"input": "deterministic-noise", "frames_per_plugin": 3, "parameters": "varied"},\n' - printf ' "library": "lib/libfrei0r-bundle-static.a",\n' - printf ' "headers": ["include/frei0r.h", "include/frei0r/bundle.h"],\n' - printf ' "tested_contracts": [' - separator= - for file in "${contract_files[@]}"; do - printf '%s"contracts/%s"' "$separator" "$file" - separator=', ' - done - printf ']\n' - printf '}\n' -} > "$package_dir/manifest.json" - -( - cd "$package_dir" - find . -type f ! -name SHA256SUMS.txt -print0 | - LC_ALL=C sort -z | - xargs -0 sha256sum -) > "$package_dir/SHA256SUMS.txt" - -tar -C "$output_dir" -czf "$archive" "$package_name" -printf '%s\n' "$archive" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/.github/workflows/release.yml new/frei0r-3.7.1/.github/workflows/release.yml --- old/frei0r-3.7.0/.github/workflows/release.yml 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/.github/workflows/release.yml 2026-11-12 10:33:52.000000000 +0100 @@ -244,7 +244,7 @@ '^(bundle-registry-wasi|bundle-wasi-consumer)$' - name: Package tested WASI bundle run: | - .github/scripts/package-wasm-release.sh \ + cmake/package-wasm-release.sh \ wasi \ "${{ needs.release-plan.outputs.version }}" \ 29 \ @@ -291,7 +291,7 @@ '^(bundle-registry-emscripten|bundle-emscripten-consumer)$' - name: Package tested Emscripten bundle run: | - .github/scripts/package-wasm-release.sh \ + cmake/package-wasm-release.sh \ emscripten \ "${{ needs.release-plan.outputs.version }}" \ 4.0.1 \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/.github/workflows/test.yml new/frei0r-3.7.1/.github/workflows/test.yml --- old/frei0r-3.7.0/.github/workflows/test.yml 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/.github/workflows/test.yml 2026-11-12 10:33:52.000000000 +0100 @@ -139,6 +139,90 @@ build/test/frei0r-run -d -p "$plugin" done + test-i386: + name: 🔬 i386 C/C++ contracts (GCC -m32) + runs-on: ubuntu-latest + defaults: + run: + shell: bash + steps: + - uses: actions/checkout@v6 + - uses: hendrikmuhs/[email protected] + with: + key: i386 + - name: Install multilib build tools + run: | + sudo dpkg --add-architecture i386 + sudo apt-get update -qy + sudo apt-get install --no-install-recommends -y \ + gcc-multilib g++-multilib cmake ninja-build pkg-config file \ + libgl-dev:i386 libegl-dev:i386 + - name: Configure native 32-bit build + env: + PKG_CONFIG_LIBDIR: /usr/lib/i386-linux-gnu/pkgconfig:/usr/share/pkgconfig + run: | + cmake -S . -B build-i386 -G Ninja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_C_COMPILER=gcc \ + -DCMAKE_CXX_COMPILER=g++ \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DCMAKE_C_FLAGS=-m32 \ + -DCMAKE_CXX_FLAGS=-m32 \ + -DBUILD_TESTING=ON \ + -DWITHOUT_OPENCV=ON \ + -DWITHOUT_CAIRO=ON \ + -DWITHOUT_GAVL=ON + - name: Build C/C++ contracts + run: | + # These targets do not link the optional graphics libraries. + cmake --build build-i386 --parallel 4 --target \ + aech0r-contract harris0r-contract slitscan0r-contract \ + motiondiff0r-alloc motiondiff0r-memory-contract motiondiff0r-small-budget + - name: Verify 32-bit binaries + run: | + for binary in \ + aech0r-contract harris0r-contract slitscan0r-contract \ + motiondiff0r-alloc motiondiff0r-memory-contract motiondiff0r-small-budget; do + file "build-i386/test/$binary" | grep 'ELF 32-bit.*Intel 80386' + done + - name: Run native i386 contracts + run: | + ctest --test-dir build-i386 --output-on-failure --no-tests=error -R \ + '^(aech0r-contract|harris0r-contract|slitscan0r-contract|motiondiff0r-(alloc|memory-contract|small-budget))$' + + test-s390x: + name: 🔬 s390x big-endian contracts (QEMU) + runs-on: ubuntu-latest + container: debian:trixie + steps: + - uses: actions/checkout@v6 + - name: Install s390x build tools and libraries + run: | + dpkg --add-architecture s390x + apt-get update -qy + apt-get install --no-install-recommends -y \ + cmake ninja-build pkg-config ccache qemu-user \ + gcc-s390x-linux-gnu g++-s390x-linux-gnu libc6-dev-s390x-cross \ + libcairo2-dev:s390x libfreetype-dev:s390x libgl-dev:s390x libegl-dev:s390x + - name: Configure s390x build + env: + PKG_CONFIG_LIBDIR: /usr/lib/s390x-linux-gnu/pkgconfig:/usr/share/pkgconfig + run: | + cmake -S . -B build-s390x -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/s390x-linux-gnu.cmake \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DWITHOUT_OPENCV=ON -DWITHOUT_GAVL=ON + - name: Build big-endian regressions + run: | + cmake --build build-s390x --parallel 4 --target \ + bundle-api-contract cairo-input-contract invert0r + - name: Run big-endian regressions under QEMU + run: | + ctest --test-dir build-s390x --output-on-failure --no-tests=error -R \ + '^(bundle-api-contract|invert0r|cairo(gradient|affineblend|blend)(-input-contract)?)$' + bundle-native: name: 📦 native bundle contracts runs-on: ubuntu-latest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/BUILD.md new/frei0r-3.7.1/BUILD.md --- old/frei0r-3.7.0/BUILD.md 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/BUILD.md 2026-11-12 10:33:52.000000000 +0100 @@ -76,6 +76,32 @@ `cmake --build --preset debug-clang-ninja` and run CTest against `build/debug-clang-ninja`. +## Big-endian tests with QEMU + +On Debian, install the cross compiler, QEMU user-mode runner and s390x +development libraries. No virtual machine or binfmt registration is needed: + +```sh +sudo dpkg --add-architecture s390x +sudo apt-get update +sudo apt-get install cmake ninja-build pkg-config ccache qemu-user \ + gcc-s390x-linux-gnu g++-s390x-linux-gnu libc6-dev-s390x-cross \ + libcairo2-dev:s390x libfreetype-dev:s390x libgl-dev:s390x libegl-dev:s390x +PKG_CONFIG_LIBDIR=/usr/lib/s390x-linux-gnu/pkgconfig:/usr/share/pkgconfig \ + cmake -S . -B build-s390x -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/s390x-linux-gnu.cmake \ + -DCMAKE_C_COMPILER_LAUNCHER=ccache \ + -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \ + -DWITHOUT_OPENCV=ON -DWITHOUT_GAVL=ON +cmake --build build-s390x --parallel 4 --target \ + bundle-api-contract cairo-input-contract invert0r +ctest --test-dir build-s390x --output-on-failure -R \ + '^(bundle-api-contract|invert0r|cairo(gradient|affineblend|blend)(-input-contract)?)$' +``` + +This runs the bundle pixel checks, Cairo input/color regressions and the +ordinary tests for the affected plugins on an emulated big-endian CPU. + ## Static plugin bundles `FREI0R_BUILD_BUNDLE=ON` builds a registry-backed bundle in addition to the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/cmake/package-wasm-release.sh new/frei0r-3.7.1/cmake/package-wasm-release.sh --- old/frei0r-3.7.0/cmake/package-wasm-release.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/frei0r-3.7.1/cmake/package-wasm-release.sh 2026-11-12 10:33:52.000000000 +0100 @@ -0,0 +1,110 @@ +#!/usr/bin/env bash + +set -Eeuo pipefail + +fatal() { + printf 'error: %s\n' "$1" >&2 + exit 1 +} + +platform=${1:?platform required} +version=${2:?version required} +sdk_version=${3:?SDK version required} +build_dir=${4:?build directory required} +output_dir=${5:?output directory required} + +[[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || + fatal "version must be SemVer without a leading v" +[[ "$sdk_version" =~ ^[0-9A-Za-z._+-]+$ ]] || + fatal "SDK version contains unsupported characters" +case "$platform" in + wasi|emscripten) ;; + *) fatal "platform must be wasi or emscripten" ;; +esac + +command -v sha256sum >/dev/null || fatal "sha256sum is required" +command -v tar >/dev/null || fatal "tar is required" + +script_dir=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P) +source_dir=$(cd "$script_dir/.." && pwd -P) +build_dir=$(cd "$build_dir" && pwd -P) +mkdir -p "$output_dir" +output_dir=$(cd "$output_dir" && pwd -P) + +package_name="frei0r-${version}_${platform}" +package_dir="$output_dir/$package_name" +archive="$output_dir/${package_name}.tar.gz" +[[ ! -e "$package_dir" && ! -e "$archive" ]] || + fatal "package output already exists: $package_name" + +mkdir -p "$package_dir/contracts" "$package_dir/include/frei0r" \ + "$package_dir/lib" +install -m 0644 "$source_dir/include/frei0r.h" \ + "$package_dir/include/frei0r.h" +install -m 0644 "$source_dir/include/frei0r/bundle.h" \ + "$package_dir/include/frei0r/bundle.h" +install -m 0644 "$build_dir/libfrei0r-bundle-static.a" \ + "$package_dir/lib/libfrei0r-bundle-static.a" + +case "$platform" in + wasi) + sdk_name=wasi-sdk + target=wasi-preview1 + runtime=node-wasi-preview1 + contract_files=( + bundle-registry-wasi.wasm + bundle-wasi-consumer.wasm + ) + for file in "${contract_files[@]}"; do + install -m 0644 "$build_dir/test/$file" "$package_dir/contracts/$file" + done + ;; + emscripten) + sdk_name=emsdk + target=emscripten + runtime=node + contract_files=( + bundle-registry-emscripten.js + bundle-registry-emscripten.wasm + bundle-emscripten-consumer.js + bundle-emscripten-consumer.wasm + ) + for file in "${contract_files[@]}"; do + install -m 0644 "$build_dir/test/$file" "$package_dir/contracts/$file" + done + ;; +esac + +{ + printf '{\n' + printf ' "schema_version": 1,\n' + printf ' "name": "frei0r-bundle",\n' + printf ' "version": "%s",\n' "$version" + printf ' "target": "%s",\n' "$target" + printf ' "bundle_profile": "core",\n' + printf ' "wasm_profile": "baseline-scalar-single-threaded",\n' + printf ' "sdk": {"name": "%s", "version": "%s"},\n' \ + "$sdk_name" "$sdk_version" + printf ' "runtime_test": "%s",\n' "$runtime" + printf ' "application_contract": {"input": "deterministic-noise", "frames_per_plugin": 3, "parameters": "varied"},\n' + printf ' "library": "lib/libfrei0r-bundle-static.a",\n' + printf ' "headers": ["include/frei0r.h", "include/frei0r/bundle.h"],\n' + printf ' "tested_contracts": [' + separator= + for file in "${contract_files[@]}"; do + printf '%s"contracts/%s"' "$separator" "$file" + separator=', ' + done + printf ']\n' + printf '}\n' +} > "$package_dir/manifest.json" + +( + cd "$package_dir" + find . -type f ! -name SHA256SUMS.txt -print0 | + LC_ALL=C sort -z | + xargs -0 sha256sum +) > "$package_dir/SHA256SUMS.txt" + +tar -C "$output_dir" -czf "$archive" "$package_name" +printf '%s\n' "$archive" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/cmake/toolchains/s390x-linux-gnu.cmake new/frei0r-3.7.1/cmake/toolchains/s390x-linux-gnu.cmake --- old/frei0r-3.7.0/cmake/toolchains/s390x-linux-gnu.cmake 1970-01-01 01:00:00.000000000 +0100 +++ new/frei0r-3.7.1/cmake/toolchains/s390x-linux-gnu.cmake 2026-11-12 10:33:52.000000000 +0100 @@ -0,0 +1,6 @@ +# Debian cross compiler and QEMU user-mode runner for big-endian tests. +set(CMAKE_SYSTEM_NAME Linux) +set(CMAKE_SYSTEM_PROCESSOR s390x) +set(CMAKE_C_COMPILER s390x-linux-gnu-gcc) +set(CMAKE_CXX_COMPILER s390x-linux-gnu-g++) +set(CMAKE_CROSSCOMPILING_EMULATOR qemu-s390x -L /usr/s390x-linux-gnu) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/docs/.vitepress/config.mts new/frei0r-3.7.1/docs/.vitepress/config.mts --- old/frei0r-3.7.0/docs/.vitepress/config.mts 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/docs/.vitepress/config.mts 2026-11-12 10:33:52.000000000 +0100 @@ -35,7 +35,8 @@ themeConfig: { nav: [ { text: 'Home', link: '/' }, - { text: 'Live demo', link: '/demo/' }, + // The demo is a standalone app, not a VitePress route. + { text: 'Live demo', link: '/demo/', target: '_self' }, { text: 'Get frei0r', link: '/get-frei0r' }, { text: 'Software', link: '/software' }, { text: 'Documentation', link: '/documentation' }, @@ -52,7 +53,7 @@ text: 'frei0r', items: [ { text: 'Home', link: '/' }, - { text: 'Live demo', link: '/demo/' }, + { text: 'Live demo', link: '/demo/', target: '_self' }, { text: 'Get frei0r', link: '/get-frei0r' }, { text: 'Supporting software', link: '/software' }, { text: 'Community', link: '/community' } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/docs/scripts/test-demo-browser-smoke.mjs new/frei0r-3.7.1/docs/scripts/test-demo-browser-smoke.mjs --- old/frei0r-3.7.0/docs/scripts/test-demo-browser-smoke.mjs 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/docs/scripts/test-demo-browser-smoke.mjs 2026-11-12 10:33:52.000000000 +0100 @@ -223,7 +223,11 @@ const page = await context.newPage() const assertNoExceptions = attachExceptionCollection(page) await installSyntheticCamera(page) - await page.goto(`${origin}/frei0r/demo/`, { waitUntil: 'networkidle' }) + await page.goto(`${origin}/frei0r/`, { waitUntil: 'networkidle' }) + await Promise.all([ + page.waitForURL(`${origin}/frei0r/demo/`, { waitUntil: 'networkidle' }), + page.locator('.VPNavBar').getByRole('link', { name: 'Live demo', exact: true }).click(), + ]) const wasmResponse = await page.request.get(`${origin}/frei0r/demo/runtime/${await page.evaluate(async () => { const manifest = await fetch('./runtime/runtime-manifest.json').then((response) => response.json()) return manifest.wasm diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/include/frei0r/cairo.h new/frei0r-3.7.1/include/frei0r/cairo.h --- old/frei0r-3.7.0/include/frei0r/cairo.h 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/include/frei0r/cairo.h 2026-11-12 10:33:52.000000000 +0100 @@ -21,6 +21,7 @@ #include <cairo.h> +#include <stdint.h> #include <string.h> #include "frei0r/math.h" @@ -230,35 +231,44 @@ } /** - * Convert frei0r RGBA to pre-multiplied alpha as needed by Cairo. + * Convert frei0r RGBA bytes to Cairo's native-endian premultiplied pixels. + * Red and blue remain swapped to match the color-setting helpers above. * - * \param rgba the image buffer with format F0R_COLOR_MODEL_RGBA8888 + * \param in the image buffer with format F0R_COLOR_MODEL_RGBA8888 + * \param out the destination buffer (may equal in) * \param pixels the size of the image buffer in number of pixels * \param alpha if >= 0, the alpha channel will be set to this value * \see frei0r_cairo_unpremultiply_rgba */ -static inline void frei0r_cairo_premultiply_rgba (unsigned char *rgba, int pixels, int alpha) +static inline void frei0r_cairo_premultiply_rgba2 (const unsigned char *in, unsigned char *out, + int pixels, int alpha) { - // Validate inputs - if (!rgba || pixels <= 0) { + if (!in || !out || pixels <= 0) { return; } - int i = pixels + 1; - while ( --i ) { - register unsigned char a = rgba[3]; - if (a == 0) { - *((uint32_t *)rgba) = 0; - } else if (a < 0xff) { - rgba[0] = ( rgba[0] * a ) >> 8; - rgba[1] = ( rgba[1] * a ) >> 8; - rgba[2] = ( rgba[2] * a ) >> 8; + while (pixels--) { + unsigned int a = in[3]; + unsigned int r = in[0], g = in[1], b = in[2]; + uint32_t pixel; + if (a < 255) { + r = (r * a) >> 8; + g = (g * a) >> 8; + b = (b * a) >> 8; } - if (alpha >= 0) rgba[3] = alpha; - rgba += 4; + if (alpha >= 0) a = (unsigned char)alpha; + pixel = ((uint32_t)a << 24) | (b << 16) | (g << 8) | r; + memcpy(out, &pixel, sizeof(pixel)); + in += 4; + out += 4; } } +static inline void frei0r_cairo_premultiply_rgba (unsigned char *rgba, int pixels, int alpha) +{ + frei0r_cairo_premultiply_rgba2(rgba, rgba, pixels, alpha); +} + /** * Convert Cairo ARGB pre-multiplied alpha to frei0r straight RGBA. * @@ -273,9 +283,15 @@ return; } - int i = pixels + 1; - while ( --i ) { - register unsigned char a = rgba[3]; + while (pixels--) { + uint32_t pixel; + unsigned int a; + memcpy(&pixel, rgba, sizeof(pixel)); + a = pixel >> 24; + rgba[0] = pixel & 255; + rgba[1] = (pixel >> 8) & 255; + rgba[2] = (pixel >> 16) & 255; + rgba[3] = a; if (a > 0 && a < 0xff) { rgba[0] = MIN(( rgba[0] << 8 ) / a, 255); rgba[1] = MIN(( rgba[1] << 8 ) / a, 255); @@ -284,43 +300,3 @@ rgba += 4; } } - -/** - * Convert frei0r RGBA to pre-multiplied alpha as needed by Cairo. - * - * \param rgba the image buffer with format F0R_COLOR_MODEL_RGBA8888 - * \param pixels the size of the image buffer in number of pixels - * \param alpha if >= 0, the alpha channel will be set to this value - * \see frei0r_cairo_premultiply_rgba - * - * This is the same as frei0r_cairo_premultiply_rgba but it writes the - * output to a different buffer. - */ -static inline void frei0r_cairo_premultiply_rgba2 (unsigned char *in, unsigned char *out, - int pixels, int alpha) -{ - // Validate inputs - if (!in || !out || pixels <= 0) { - return; - } - - int i = pixels + 1; - while ( --i ) { - register unsigned char a = in[3]; - if (a == 0) { - *((uint32_t *)out) = 0; - } else if (a == 0xff) { - memcpy(out, in, 4); - } else { - out[0] = ( in[0] * a ) >> 8; - out[1] = ( in[1] * a ) >> 8; - out[2] = ( in[2] * a ) >> 8; - if (alpha < 0) - out[3] = a; - } - if (alpha >= 0) - out[3] = alpha; - in += 4; - out += 4; - } -} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/src/filter/cairogradient/cairogradient.c new/frei0r-3.7.1/src/filter/cairogradient/cairogradient.c --- old/frei0r-3.7.0/src/filter/cairogradient/cairogradient.c 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/src/filter/cairogradient/cairogradient.c 2026-11-12 10:33:52.000000000 +0100 @@ -330,13 +330,19 @@ cairo_gradient_instance_t* inst = (cairo_gradient_instance_t*)instance; unsigned char* dst = (unsigned char*)outframe; - unsigned char* src = (unsigned char*)inframe; int pixels = inst->width * inst->height; + unsigned char* src = malloc((size_t)pixels * sizeof(uint32_t)); + if (!src) { + memcpy(outframe, inframe, (size_t)pixels * sizeof(uint32_t)); + return; + } + + frei0r_cairo_premultiply_rgba2((const unsigned char*)inframe, src, pixels, -1); // Clear the destination memset(dst, 0, pixels * sizeof(uint32_t)); - frei0r_cairo_premultiply_rgba (src, pixels, -1); draw_gradient(inst, dst, src, time); frei0r_cairo_unpremultiply_rgba (dst, pixels); + free(src); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/src/filter/harris0r/harris0r.c new/frei0r-3.7.1/src/filter/harris0r/harris0r.c --- old/frei0r-3.7.0/src/filter/harris0r/harris0r.c 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/src/filter/harris0r/harris0r.c 2026-11-12 10:33:52.000000000 +0100 @@ -170,7 +170,11 @@ double value = *((double*)param); if (value < 0.0) value = 0.0; if (value > 1.0) value = 1.0; - inst->delay = HARRIS_DELAY_MIN + (unsigned int)(value * (HARRIS_DELAY_MAX - HARRIS_DELAY_MIN)); + /* Store as double before truncating: x87 can otherwise keep the + * product just below an integer. Volatile forces this rounding + * even when the compiler ignores casts under excess precision. */ + volatile double frames = value * (HARRIS_DELAY_MAX - HARRIS_DELAY_MIN); + inst->delay = HARRIS_DELAY_MIN + (unsigned int)frames; break; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/src/filter/invert0r/invert0r.c new/frei0r-3.7.1/src/filter/invert0r/invert0r.c --- old/frei0r-3.7.0/src/filter/invert0r/invert0r.c 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/src/filter/invert0r/invert0r.c 2026-11-12 10:33:52.000000000 +0100 @@ -56,18 +56,22 @@ { /* no params */ } void f0r_update(f0r_instance_t instance, double time, - const uint32_t* inframe, uint32_t* outframe) + const uint32_t* inframe, uint32_t* outframe) { assert(instance); inverter_instance_t* inst = (inverter_instance_t*)instance; - unsigned int w = inst->width; - unsigned int h = inst->height; - unsigned int x,y; - - uint32_t* dst = outframe; - const uint32_t* src = inframe; - for(y=0;y<h;++y) - for(x=0;x<w;++x,++src) - *dst++ = 0x00ffffff^(*src); + unsigned int pixels = inst->width * inst->height; + unsigned char* dst = (unsigned char*)outframe; + const unsigned char* src = (const unsigned char*)inframe; + + /* RGBA channels are ordered bytes, not uint32_t bit fields. */ + while (pixels--) { + dst[0] = 255 - src[0]; + dst[1] = 255 - src[1]; + dst[2] = 255 - src[2]; + dst[3] = src[3]; + src += 4; + dst += 4; + } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/src/mixer2/cairoaffineblend/cairoaffineblend.c new/frei0r-3.7.1/src/mixer2/cairoaffineblend/cairoaffineblend.c --- old/frei0r-3.7.0/src/mixer2/cairoaffineblend/cairoaffineblend.c 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/src/mixer2/cairoaffineblend/cairoaffineblend.c 2026-11-12 10:33:52.000000000 +0100 @@ -307,13 +307,21 @@ assert(instance); cairo_affineblend_instance_t* inst = (cairo_affineblend_instance_t*) instance; - unsigned char* dst = (unsigned char*)inframe1; - unsigned char* src = (unsigned char*)inframe2; unsigned char* out = (unsigned char*)outframe; int pixels = inst->width * inst->height; + unsigned char* dst = malloc((size_t)pixels * sizeof(uint32_t)); + unsigned char* src = malloc((size_t)pixels * sizeof(uint32_t)); + if (!dst || !src) { + free(dst); + free(src); + memcpy(outframe, inframe1, (size_t)pixels * sizeof(uint32_t)); + return; + } - frei0r_cairo_premultiply_rgba (dst, pixels, -1); - frei0r_cairo_premultiply_rgba (src, pixels, -1); + frei0r_cairo_premultiply_rgba2((const unsigned char*)inframe1, dst, pixels, -1); + frei0r_cairo_premultiply_rgba2((const unsigned char*)inframe2, src, pixels, -1); draw_composite (inst, out, dst, src, time); frei0r_cairo_unpremultiply_rgba (out, pixels); + free(src); + free(dst); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/src/mixer2/cairoblend/cairoblend.c new/frei0r-3.7.1/src/mixer2/cairoblend/cairoblend.c --- old/frei0r-3.7.0/src/mixer2/cairoblend/cairoblend.c 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/src/mixer2/cairoblend/cairoblend.c 2026-11-12 10:33:52.000000000 +0100 @@ -236,8 +236,7 @@ assert(instance); cairo_blend_instance_t* inst = (cairo_blend_instance_t*) instance; - unsigned char* dst = (unsigned char*)inframe1; - unsigned char* src = (unsigned char*)inframe2; + const unsigned char* dst = (const unsigned char*)inframe1; unsigned char* out = (unsigned char*)outframe; int pixels = inst->width * inst->height; @@ -245,9 +244,15 @@ if (pixels <= 0) { return; } + unsigned char* src = malloc((size_t)pixels * sizeof(uint32_t)); + if (!src) { + memcpy(outframe, inframe1, (size_t)pixels * sizeof(uint32_t)); + return; + } + frei0r_cairo_premultiply_rgba2((const unsigned char*)inframe2, src, pixels, -1); frei0r_cairo_premultiply_rgba2 (dst, out, pixels, -1); - frei0r_cairo_premultiply_rgba (src, pixels, -1); draw_composite (inst, out, src, time); frei0r_cairo_unpremultiply_rgba (out, pixels); + free(src); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/test/CMakeLists.txt new/frei0r-3.7.1/test/CMakeLists.txt --- old/frei0r-3.7.0/test/CMakeLists.txt 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/test/CMakeLists.txt 2026-11-12 10:33:52.000000000 +0100 @@ -5,6 +5,16 @@ add_executable(frei0r-run test-pattern.c frei0r-run.c) add_executable(frei0r-meta frei0r-meta.c) +if(UNIX AND TARGET cairogradient) + add_executable(cairo-input-contract cairo-input-contract.c) + target_include_directories(cairo-input-contract PRIVATE ${Cairo_INCLUDE_DIRS}) + target_link_libraries(cairo-input-contract PRIVATE ${CMAKE_DL_LIBS} ${Cairo_LIBRARIES}) + foreach(plugin cairogradient cairoaffineblend cairoblend) + add_dependencies(cairo-input-contract ${plugin}) + add_test(NAME ${plugin}-input-contract + COMMAND cairo-input-contract $<TARGET_FILE:${plugin}>) + endforeach() +endif() add_executable(whirlpinch0r-contract whirlpinch0r-contract.c) add_dependencies(whirlpinch0r-contract whirlpinch0r) add_test(NAME whirlpinch0r-contract @@ -266,7 +276,7 @@ add_test(NAME wasm-release-package COMMAND ${FREI0R_BASH_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/check-wasm-release-package.sh - ${CMAKE_SOURCE_DIR}/.github/scripts/package-wasm-release.sh + ${CMAKE_SOURCE_DIR}/cmake/package-wasm-release.sh ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}) endif() @@ -442,7 +452,7 @@ add_dependencies(${target} frei0r-run) add_test( NAME "${target}" - COMMAND "${CMAKE_BINARY_DIR}/test/frei0r-run" ${TESTFLAGS} -p "$<TARGET_FILE:${target}>" + COMMAND frei0r-run ${TESTFLAGS} -p "$<TARGET_FILE:${target}>" WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/test" ) endforeach() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/test/bundle-api-contract.c new/frei0r-3.7.1/test/bundle-api-contract.c --- old/frei0r-3.7.0/test/bundle-api-contract.c 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/test/bundle-api-contract.c 2026-11-12 10:33:52.000000000 +0100 @@ -1,4 +1,5 @@ #include <stdint.h> +#include <stdio.h> #include <string.h> #include "frei0r/bundle.h" @@ -58,13 +59,30 @@ return 5; brightness->set_param_value(brightness_instance, &value, 0); - for (index = 0; index < 64; ++index) - input[index] = UINT32_C(0x80402010); + /* RGBA8888 describes bytes in memory, independently of host byte order. */ + for (index = 0; index < 64; ++index) { + unsigned char *pixel = (unsigned char *)&input[index]; + pixel[0] = 0x10; + pixel[1] = 0x20; + pixel[2] = 0x40; + pixel[3] = (unsigned char)(index * 4); + } brightness->update(brightness_instance, 0.0, input, brightness_output); invert0r->update(invert0r_instance, 0.0, input, invert0r_output); - if (brightness_output[0] != UINT32_C(0x80a09088) || - invert0r_output[0] != UINT32_C(0x80bfdfef)) - return 6; + for (index = 0; index < 64; ++index) { + const unsigned char *bright = (const unsigned char *)&brightness_output[index]; + const unsigned char *inverse = (const unsigned char *)&invert0r_output[index]; + unsigned char alpha = (unsigned char)(index * 4); + if (bright[0] != 0x88 || bright[1] != 0x90 || bright[2] != 0xa0 || + bright[3] != alpha || inverse[0] != 0xef || inverse[1] != 0xdf || + inverse[2] != 0xbf || inverse[3] != alpha) { + fprintf(stderr, "Unexpected RGBA output at pixel %zu: " + "brightness=%02x %02x %02x %02x, invert0r=%02x %02x %02x %02x\n", + index, bright[0], bright[1], bright[2], bright[3], + inverse[0], inverse[1], inverse[2], inverse[3]); + return 6; + } + } brightness->destruct(brightness_instance); invert0r->destruct(invert0r_instance); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/test/cairo-input-contract.c new/frei0r-3.7.1/test/cairo-input-contract.c --- old/frei0r-3.7.0/test/cairo-input-contract.c 1970-01-01 01:00:00.000000000 +0100 +++ new/frei0r-3.7.1/test/cairo-input-contract.c 2026-11-12 10:33:52.000000000 +0100 @@ -0,0 +1,122 @@ +#include <dlfcn.h> +#include <cairo.h> +#include <stdint.h> +#include <stdio.h> +#include <string.h> + +#include "frei0r.h" + +int main(int argc, char **argv) +{ + void *module; + int (*init)(void); + void (*deinit)(void); + void (*get_info)(f0r_plugin_info_t *); + f0r_instance_t (*construct)(unsigned int, unsigned int); + void (*destruct)(f0r_instance_t); + void (*set_param)(f0r_instance_t, f0r_param_t, int); + void (*update)(f0r_instance_t, double, const uint32_t *, uint32_t *); + void (*update2)(f0r_instance_t, double, const uint32_t *, const uint32_t *, + const uint32_t *, uint32_t *); + f0r_plugin_info_t info; + f0r_instance_t instance; + uint32_t storage[6 * 64 + 4]; + uint32_t *first = (uint32_t *)(((uintptr_t)storage + 15) & ~(uintptr_t)15); + uint32_t *second = first + 64; + uint32_t *saved_first = second + 64; + uint32_t *saved_second = saved_first + 64; + uint32_t *output = saved_second + 64; + uint32_t *repeated = output + 64; + const size_t frame_bytes = 64 * sizeof(uint32_t); + unsigned int pass, index; + int failed = 0; + + if (argc != 2 || !(module = dlopen(argv[1], RTLD_NOW))) { + fprintf(stderr, "Cannot load Cairo plugin\n"); + return 1; + } +#define LOAD(symbol, target) \ + do { \ + *(void **)(&(target)) = dlsym(module, symbol); \ + if (!(target)) { fprintf(stderr, "Missing %s\n", symbol); return 1; } \ + } while (0) + LOAD("f0r_init", init); + LOAD("f0r_deinit", deinit); + LOAD("f0r_get_plugin_info", get_info); + LOAD("f0r_construct", construct); + LOAD("f0r_destruct", destruct); + LOAD("f0r_set_param_value", set_param); + get_info(&info); + if (info.plugin_type == F0R_PLUGIN_TYPE_FILTER) { + LOAD("f0r_update", update); + } else { + LOAD("f0r_update2", update2); + } +#undef LOAD + if (!init() || !(instance = construct(8, 8))) return 1; + + /* Opaque, translucent and transparent frames must all remain read-only. */ + for (pass = 0; pass < 3 && !failed; ++pass) { + for (index = 0; index < 64; ++index) { + unsigned char *a = (unsigned char *)&first[index]; + unsigned char *b = (unsigned char *)&second[index]; + a[0] = 16; a[1] = 32; a[2] = 64; + b[0] = 200; b[1] = 100; b[2] = 50; + a[3] = pass == 0 ? 255 : pass == 1 ? 64 : 0; + b[3] = pass == 0 ? 255 : pass == 1 ? 128 : 0; + } + memcpy(saved_first, first, frame_bytes); + memcpy(saved_second, second, frame_bytes); + if (info.plugin_type == F0R_PLUGIN_TYPE_FILTER) { + double opacity = 0.0; + set_param(instance, &opacity, 2); + set_param(instance, &opacity, 4); + update(instance, 0.0, first, output); + update(instance, 0.0, first, repeated); + } else { + update2(instance, 0.0, first, second, NULL, output); + update2(instance, 0.0, first, second, NULL, repeated); + } + if (memcmp(first, saved_first, frame_bytes) || + memcmp(second, saved_second, frame_bytes) || + memcmp(output, repeated, frame_bytes)) { + fprintf(stderr, "%s: input mutation or unstable output, alpha case %u\n", + info.name, pass); + failed = 1; + } + if (pass == 0) { + const uint32_t *expected = info.plugin_type == F0R_PLUGIN_TYPE_FILTER + ? saved_first : saved_second; + if (memcmp(output, expected, frame_bytes)) { + fprintf(stderr, "%s: opaque RGBA colors or alpha changed\n", info.name); + failed = 1; + } + } + } + + if (!failed && info.plugin_type == F0R_PLUGIN_TYPE_FILTER) { + f0r_param_color_t color = {0.25, 0.5, 0.75}; + double opacity = 1.0; + set_param(instance, &color, 1); + set_param(instance, &color, 3); + set_param(instance, &opacity, 2); + set_param(instance, &opacity, 4); + update(instance, 0.0, first, output); + for (index = 0; index < 64; ++index) { + const unsigned char *pixel = (const unsigned char *)&output[index]; + if (pixel[0] < 63 || pixel[0] > 64 || pixel[1] < 127 || + pixel[1] > 128 || pixel[2] < 191 || pixel[2] > 192 || pixel[3] != 255) { + fprintf(stderr, "%s: gradient RGBA color or alpha changed\n", info.name); + failed = 1; + break; + } + } + } + + destruct(instance); + deinit(); + /* Release Cairo's process-wide caches before unloading it under leak checks. */ + cairo_debug_reset_static_data(); + dlclose(module); + return failed; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/frei0r-3.7.0/test/harris0r-contract.c new/frei0r-3.7.1/test/harris0r-contract.c --- old/frei0r-3.7.0/test/harris0r-contract.c 2026-11-05 22:10:33.000000000 +0100 +++ new/frei0r-3.7.1/test/harris0r-contract.c 2026-11-12 10:33:52.000000000 +0100 @@ -95,6 +95,18 @@ f0r_get_param_value(instance, &again, 0); if (fabs(value - normalized) > 1e-12 || fabs(again - value) > 1e-12) goto failed; + /* Keep truncation on either side of each normalized frame setting; + * adding a broad epsilon or rounding to nearest changes the bins. */ + if (index > 0) { + parameter(instance, 0, normalized - 1e-9); + f0r_get_param_value(instance, &value, 0); + if (fabs(value - (index - 1) / 15.0) > 1e-12) goto failed; + } + if (index < 15) { + parameter(instance, 0, normalized + 1e-9); + f0r_get_param_value(instance, &value, 0); + if (fabs(value - normalized) > 1e-12) goto failed; + } } parameter(instance, 0, 0.5); f0r_get_param_value(instance, &value, 0); @@ -212,8 +224,7 @@ int main(void) { - const unsigned int delays[] = { 1, 2, 16 }; - unsigned int i; + unsigned int delay; int simple, inplace, errors; void *storage; uint32_t *input, *output; @@ -223,10 +234,10 @@ input = (uint32_t *)(((uintptr_t)storage + 15) & ~(uintptr_t)15); output = input + pixels; errors = mapping(); - for (i = 0; i < sizeof(delays) / sizeof(delays[0]); ++i) + for (delay = 1; delay <= 16; ++delay) for (simple = 0; simple < 2; ++simple) for (inplace = 0; inplace < 2; ++inplace) - errors += sequence(input, output, delays[i], simple, inplace); + errors += sequence(input, output, delay, simple, inplace); errors += mode_changes(input, output); errors += allocation_failures(input, output); free(storage);
