Download the PHP package localtools/ai-meta-php without Composer

On this page you can find all versions of the php package localtools/ai-meta-php. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package ai-meta-php

ai_meta (PHP)

CI Release

ai-meta-php is a traditional C PHP extension (phpize / config.m4, not FFI) for detecting, extracting, stripping, and writing AI-generation metadata declared in image files.

It wraps the ai_meta C library and links prebuilt release binaries of that library (pinned by LIBAI_META_VERSION).

Why

Generators and platforms increasingly embed provenance and generation parameters (Stable Diffusion parameters, EXIF/XMP, C2PA Content Credentials, IPTC). This extension gives PHP applications a small, dependency-light way to inspect and scrub that metadata while leaving pixel data and color profiles intact when requested.

Features

Capability Notes
Formats PNG, JPEG, WebP
Schemes PNG text (tEXt / iTXt / zTXt), EXIF, XMP, IPTC (JPEG), C2PA detect/strip/hints
Scan Fast format + scheme bitmask + likely_ai
Extract Associative field map (e.g. parameters, prompt, Seed, …)
Strip / write Returns a new binary buffer; input is never mutated
Errors AiMetaException with messages from ai_meta_strerror()

C2PA signatures are not cryptographically verified (same as the C library).

Quick start

Requirements

Build & test

The configure step prefers lib/libai_meta.a so the resulting ai_meta.so does not need libai_meta at runtime (only zlib).

Alternative discovery:

Load

See examples/basic.php.

Install with PIE

This extension supports PIE (PHP Installer for Extensions). Package metadata lives in composer.json (type: php-ext).

Source builds need a prebuilt ai_meta library:

composer.json declares download-url-method: ["pre-packaged-binary", "composer-default"], so PIE prefers a matching release binary and falls back to building from source.

Publish to Packagist (submit the GitHub repo) so pie install localtools/ai-meta-php resolves without a path repository.

Prebuilt packages

Extension (this repo)

GitHub Releases attach PIE-compatible binaries (via php/pie-ext-binary-builder):

Local packaging after a successful make:

Tag a release to build and attach PIE assets automatically:

Native library (dependency)

Item Location
Releases https://github.com/localtools/ai-meta/releases
Pin file LIBAI_META_VERSION
Fetch helper scripts/fetch-libai-meta.sh

This extension does not vendor or compile libai_meta sources.

PHP API

On any non-OK library status, an AiMetaException (extends RuntimeException) is thrown.

Constants

Constant Role
AI_META_FLAG_NONE No strip flags
AI_META_FLAG_STRIP_PNG_TEXT / STRIP_EXIF / STRIP_XMP / STRIP_IPTC / STRIP_C2PA Per-scheme strip
AI_META_FLAG_STRIP_ALL_AI All AI-related strip bits
AI_META_FLAG_KEEP_COLOR_PROFILE Preserve ICC / color profile when possible
AI_META_FLAG_KEEP_NON_AI_TEXT Keep benign PNG text when stripping
AI_META_SCHEME_* Scheme bitmask values (mirror the C API)

IDE / static-analysis stubs: ai_meta.stub.php.

Conventions

Topic Rule
Errors Throw AiMetaException; message from ai_meta_strerror()
Memory Library buffers are freed inside the extension before return
Strip / write Always return a new string buffer
Color profiles Preserved when AI_META_FLAG_KEEP_COLOR_PROFILE is set (recommended)

Design

Out of scope

Testing

.phpt coverage includes scan, extract, write/strip round-trip, and exception paths against small PNG fixtures under tests/fixtures/.

CI: .github/workflows/ci.yml.

Project layout

Contributing

Contributions are welcome. See Code of Conduct.

For security issues, see SECURITY.md — please do not open public issues for vulnerabilities.

Changelog

See CHANGELOG.md.

License

This project is licensed under the MIT License — see NOTICE.

You may use, modify, and distribute this software under the terms of that license.

The native ai_meta library is also MIT-licensed; prebuilt binaries are obtained from its GitHub Releases.


All versions of ai-meta-php with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package localtools/ai-meta-php contains the following files

Loading the files please wait ...