Download the PHP package mattsplat/fastresize-php without Composer
On this page you can find all versions of the php package mattsplat/fastresize-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mattsplat/fastresize-php
More information about mattsplat/fastresize-php
Files in mattsplat/fastresize-php
Package fastresize-php
Short Description PHP FFI binding for fastresize - a fast C++ image decode/resize/composite/encode library - as an alternative to libvips-backed wrappers like jcupitt/vips.
License MIT
Informations about the package fastresize-php
fastresize-php
PHP FFI binding for fastresize -
a small, single-purpose C++ image decode/resize/composite/encode library. No
algorithm is reimplemented here: src/FastResize.php calls straight into
fastresize_capi.h's C ABI shim (bundled in native/) via PHP's ext-ffi.
Install
Then build the native library - not done automatically by composer install, deliberately: compiling C++ on every consumer's install (CI
included) is a bigger surprise than one explicit extra step.
This curls the pinned stb_image/stb_image_resize2/stb_image_write
headers and fpng (v1.0.6, the PNG
encoder - ~12x faster than stb_image_write, ~8% larger files) into
native/vendor/ and compiles libfastresize_capi.so (.dylib on macOS)
into the package root, right next to native/. Requires a C++17 compiler
(clang++ by default - override with make CXX=g++) and curl.
ext-ffi must be enabled (ffi.enable=1 in php.ini, or "preload" per the
PHP FFI docs for non-CLI
SAPIs).
Usage
See fastresize_capi.h in native/ (or the
fastresize repo) for the full
underlying API and fastresize.h's own header comment for the case against
libvips this library is making.
Tests
tests/FastResizeTest.php drives every method against the real compiled
library (decode/probe/resize/crop/fill/composite/encode, opaque-rect
tightness, RGB-vs-RGBA output, transparent-pixel flattening). The pixel
assertions use ext-gd and self-skip if it is missing. CI runs the suite
on PHP 8.1–8.4.
License
MIT - see LICENSE.
All versions of fastresize-php with dependencies
ext-ffi Version *