{"id":23003726,"url":"https://github.com/stechstudio/libvips-lambda","last_synced_at":"2025-08-17T05:06:54.817Z","repository":{"id":150650102,"uuid":"90412773","full_name":"stechstudio/libvips-lambda","owner":"stechstudio","description":"libvips Executable for AWS Lambda","archived":false,"fork":false,"pushed_at":"2019-12-05T07:18:43.000Z","size":61,"stargazers_count":45,"open_issues_count":3,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-08-14T01:32:33.392Z","etag":null,"topics":["aws-lambda","docker","libvips","vips-executions"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stechstudio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-05-05T20:12:26.000Z","updated_at":"2025-06-26T21:30:50.000Z","dependencies_parsed_at":"2023-06-12T06:45:33.267Z","dependency_job_id":null,"html_url":"https://github.com/stechstudio/libvips-lambda","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/stechstudio/libvips-lambda","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Flibvips-lambda","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Flibvips-lambda/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Flibvips-lambda/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Flibvips-lambda/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stechstudio","download_url":"https://codeload.github.com/stechstudio/libvips-lambda/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stechstudio%2Flibvips-lambda/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270807934,"owners_count":24649346,"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","status":"online","status_checked_at":"2025-08-17T02:00:09.016Z","response_time":129,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["aws-lambda","docker","libvips","vips-executions"],"created_at":"2024-12-15T07:15:11.016Z","updated_at":"2025-08-17T05:06:54.788Z","avatar_url":"https://github.com/stechstudio.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# libvips : Executable for AWS Lambda\n\n[libvips](https://github.com/jcupitt/libvips) is a 2D image processing library. Compared to similar libraries, [libvips runs quickly and uses little memory](https://github.com/jcupitt/libvips/wiki/Speed-and-memory-use).\nlibvips is licensed under the LGPL 2.1+.\n\nWe use libvips for image manipulation, primarily tiling image pyramids for blueprints and other construction industry artifacts, which results in about seven thousand vips executions a day for the past several years. We have long wanted to move that processing to AWS Lambda, and were hung up on getting a vips executable into AWS.\n\nIn the fall of 2016, I had a good chat with [@jcupitt](https://github.com/jcupitt) and [@lovell](https://github.com/lovell) about the issue in [jcupitt/libvips#492](https://github.com/jcupitt/libvips/issues/492) and @lovell pointed out that they were building vips libraries for the Node.js module [Sharp](https://github.com/lovell/sharp). Sharp builds the shared libraries that have a single runtime dependency of `glibc v2.13+` and the latest Amazon Linux is further along than that.\n\nIf we were looking for a Node.js solution in AWS Lambda, we could have simply used the sharp module. If you are using Node.js, you should probably stop here and just go use Sharp. However, we required an executable that we could call directly. So I adapted the [sharp vips build tools](https://github.com/lovell/sharp/tree/master/packaging) to allow us to get what we are after, an executable.\n\nIt really didn't take much once I dug around the Sharp Repository a bit and found how they are building for the latest vips. We are ultimately just adding the `/bin` directory to the resulting archive.\n\nOver time, I expect we will diverge from the Sharp code base significantly, but if nothing else, this is a handy place for us to quickly get the binary we desire for AWS Lambda.\n\n# Using libvips for AWS Lambda\n\nWe keep some pre-baked tarballs on the release page:\n\nhttps://github.com/stechstudio/libvips-lambda/releases\n\nYou can simply untar that and skip the entire build process if you like.\n\n# Building libvips for AWS Lambda\n\nThe process depends on [Docker](https://docs.docker.com/engine/installation/) being installed.\n\nClone this repository and run:\n\n    $ ./build-vips.sh 8.5.6\n\nWhen all is said and done you should have something like `dist/libvips-8.5.6-linux-x64.tar.gz` in your working directory.\n\n\n# Building libvips with php-vips-ext for AWS Lambda\n\nThe process depends on [Docker](https://docs.docker.com/engine/installation/) being installed.\n\nIt is important to note that for running in Lambda we need to ensure that PHP is compiled against the exact same\nlibraries that we use for VIPS and the subsequent compilation of the PECL extension needs to build against those as well. \nSimply using PECL will not work because PECL gets easily confused with other system libraries that we are overriding.\n\nClone this repository and run:\n\n    $ ./build-phpvips.sh 8.5.6 7.1.6 1.0.7\n\nWhen all is said and done you should have something like `dist/vips-8.5.6_php-7.1.6_ext-php-1.0.7-lambda.tar.gz` in your working directory.\n\n# Using libvips in an AWS Lambda Package\n\nCreating a [Lambda Deployment Package](http://docs.aws.amazon.com/lambda/latest/dg/lambda-python-how-to-create-deployment-package.html) is beyond the scope of this read me. However, you need to be familiar with the process.\n\nGo about creating your Deployment Package as normal, and extract the libvips tarfile into your base directory. This will \nresult in new directories (assumes PHP build )if they didn't previously exist:\n\n      ./bin         Our Binaries\n      ./etc         Pear configuration\n      ./include     Headers for everything we built\n      ./lib         All the Shared Libraries\n      ./modules     PHP Module Config Dir\n\nYou will find vips at `./bin/vips` along with all the other executables we created. If you were to add everything to your\nlambda package it would be about 30M zipped and 86M on disk. However, you probably only want one or two of the executables\nin which case you should cherry pick only the executables your lambda function needs. The entire `./bin` directory is about \n45MB on disk.\n\nThere is probably no reason to deploy the `./include` (15M on disk) to lambda at all. It is only packaged to allow additional\ncompilation if desired.\n\nThe `./lib` (27M on disk) directory is the big one. Just assume you need every file in the root directory for `vips` or `php` to work\nproperly at all. However, there are a number of subdirectories that you don't need at all, and you can effectively delete\nall of them prior to lambda deployment to save a little space.\n\nNote that there are a large number of symlinks in the `./lib` directory and it is important that those be maintained when \ncreating your lambda package. Not all operating systems nor zipping programs properly handle the symlinks. You are warned.\n\nIn your code you can reference `/var/task/bin/vips` and you will need to ensure you customize the Lambda Function \nEnvironment Variables:\n```bash\nLD_LIBRARY_PATH=${LAMBDA_TASK_ROOT}/lib:LD_LIBRARY_PATH\nPATH=${LAMBDA_TASK_ROOT}/bin:${LAMBDA_TASK_ROOT}:${PATH}\n ```\n\nThis will ensure our libraries and binaries get preference.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstechstudio%2Flibvips-lambda","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstechstudio%2Flibvips-lambda","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstechstudio%2Flibvips-lambda/lists"}