{"id":28438020,"url":"https://github.com/libvips/php-vips-ext","last_synced_at":"2025-07-27T19:35:39.900Z","repository":{"id":37821933,"uuid":"67282863","full_name":"libvips/php-vips-ext","owner":"libvips","description":"Low-level libvips binding for PHP","archived":false,"fork":false,"pushed_at":"2024-10-12T08:39:46.000Z","size":5774,"stargazers_count":102,"open_issues_count":10,"forks_count":11,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-06-19T20:14:29.102Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/libvips.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-09-03T09:45:53.000Z","updated_at":"2025-06-06T20:08:20.000Z","dependencies_parsed_at":"2025-04-26T02:01:51.390Z","dependency_job_id":"0f7cdd61-eb6c-4037-9376-49d07a74a298","html_url":"https://github.com/libvips/php-vips-ext","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/libvips/php-vips-ext","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libvips%2Fphp-vips-ext","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libvips%2Fphp-vips-ext/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libvips%2Fphp-vips-ext/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libvips%2Fphp-vips-ext/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/libvips","download_url":"https://codeload.github.com/libvips/php-vips-ext/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/libvips%2Fphp-vips-ext/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262452297,"owners_count":23313415,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-06T00:38:42.037Z","updated_at":"2025-07-27T19:35:39.875Z","avatar_url":"https://github.com/libvips.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Low-level PHP binding for libvips \n\n**This extension is deprecated** php-vips 2.0+ has switched to FFI for calls\ninto the libvips binary, so this extension is no longer necessary. It will not\nbe updated again (though it might still be useful if for some reason you don't\n/ can't update to php-vips 2.0).\n\nThis extension lets you use the libvips image processing library\nfrom PHP 7 and PHP 8. \n\nThis is not supposed to be used directly! Install this, then use \n[php-vips 1.x](https://github.com/libvips/php-vips) to layer a nice (and\ndocumented!) API on top of this extension.\n\nlibvips is fast and needs little memory. The [`vips-php-bench`](\nhttps://github.com/jcupitt/php-vips-bench) repository tests\n`php-vips` against `imagick` and `gd`: on that test, and on my laptop,\n`php-vips` is around four times faster than `imagick` and needs 10 times less\nmemory. \n\n### Example\n\n```php\n#!/usr/bin/env php\n\u003c?php\n\n# never use this extension directly! this is just an example\n$x = vips_image_new_from_file($argv[1])[\"out\"];\n$x = vips_call(\"invert\", $x)[\"out\"];\nvips_image_write_to_file($x, $argv[2]);\n```\n\nAlmost all operations return an array of result values. Usually there is a\nsingle result called `\"out\"`.\n\nUse `vips_call()` to call any operation in the vips library. There are around \naround 300 operations available, see the vips docs for an introduction:\n\nhttp://libvips.github.io/libvips/API/current/\n\nArguments can be long, double, image, array of long, array of double or array\nof image. The final argument to `vips_call()` is an array of operation options. \n\n`php-vips` layers a nice API, including full docs, on top of this extension, \nsee:\n\nhttps://github.com/libvips/php-vips\n\n### Installing\n\nFirst install the libvips library. It will be in your package manager on linux,\nit's in brew and MacPorts on macOS, or the vips website has Windows binaries.\n\nNext, install this extension:\n\n```\n$ pecl install vips\n```\n\nAnd add:\n\n```\nextension=vips.so\n```\n\nto your `php.ini`.\n\nFinally, add `vips` to your `composer.json` to pull in the high-level PHP API. \n\n```\n    \"require\": {\n            \"jcupitt/vips\" : \"1.0.0\"\n    }\n```\n\nThe high-level API has all the documentation, see:\n\nhttps://github.com/libvips/php-vips\n\n### Development: preparation\n\nPHP is normally built for speed and is missing a lot of debugging support you\nneed for extension development. For testing and dev, build your own php. \nI used 7.0.11 and configured with:\n\n```\n$ ./configure --prefix=/home/john/vips --enable-debug --enable-maintainer-zts \\\n    --enable-cgi --enable-cli --with-readline --with-openssl --with-zlib \\\n    --with-gd --with-jpeg-dir=/usr --with-libxml-dir=/usr --enable-mbstring \n```\n\nYou'll need libvips 8.2 or later, including all the headers for\ndevelopment.  On linux, install with your package manager.  On macOS,\ninstall with `brew` or MacPorts. For Windows, download a zip from the\nlibvips website, or build your own.\n\n### Development: regenerate build system\n\n```\n$ pear package\n```\n\nTo make `vips-1.0.13.tgz`.\n\nTo install by hand:\n\n```\n$ phpize\n```\n\nTo scan `config.m4` and your php install and regenerate the build system.\n\n### Development: configure\n\nRun\n\n```\n$ ./configure \n```\n\nCheck the output carefully for errors, and obviously check that it found your\nlibvips.\n\n### Development: make, test and install\n\nRun:\n\n```\n$ make\n```\n\nTo build the module to the `modules/` directory in this repository. \n\nDon't post php-vips test results to php.net! Stop this with:\n\n```\n$ export NO_INTERACTION=1\n```\n\nTest with:\n\n```\n$ make test\n```\n\nFinally, install to your php extensions area with:\n\n```\n$ make install\n```\n\nAdd `extension=vips.so` to `php.ini`, perhaps in `~/vips/lib/php.ini`, \nif you configured php as above. \n\n### Development: regenerate `vips_arginfo.h`\n\nRun:\n\n```\n$ curl -LO https://github.com/php/php-src/raw/ffacda14b88be797a466f472359f306d626e698f/build/gen_stub.php\n$ php gen_stub.php\n```\n\n### Links\n\nhttp://php.net/manual/en/internals2.php\n\nhttps://devzone.zend.com/303/extension-writing-part-i-introduction-to-php-and-zend/\n\nhttps://devzone.zend.com/317/extension-writing-part-ii-parameters-arrays-and-zvals/\n\nhttps://devzone.zend.com/446/extension-writing-part-iii-resources/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibvips%2Fphp-vips-ext","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flibvips%2Fphp-vips-ext","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flibvips%2Fphp-vips-ext/lists"}