PHPackages                             frameright/image-metadata-parser - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Image &amp; Media](/categories/media)
4. /
5. frameright/image-metadata-parser

ActiveLibrary[Image &amp; Media](/categories/media)

frameright/image-metadata-parser
================================

Image metadata parsing library

1.2.0(11mo ago)1133.9k↓31.1%1[5 issues](https://github.com/Frameright/php-image-metadata-parser/issues)MITPHPPHP &gt;=5.5CI passing

Since Oct 11Pushed 11mo ago2 watchersCompare

[ Source](https://github.com/Frameright/php-image-metadata-parser)[ Packagist](https://packagist.org/packages/frameright/image-metadata-parser)[ RSS](/packages/frameright-image-metadata-parser/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (10)Used By (0)

[![Packagist Version](https://camo.githubusercontent.com/6bf2f07021c8661b22b9c8f36788815398edcf88e02b74dc315acfaad14d7f58/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6672616d6572696768742f696d6167652d6d657461646174612d706172736572)](https://packagist.org/packages/frameright/image-metadata-parser)

Image metadata parsing library (PHP 5.5+)
=========================================

[](#image-metadata-parsing-library-php-55)

> **➡️ See this document rendered at [docs.frameright.io/php](https://docs.frameright.io/php)**

> **NOTE**: this is based on [dchesterton/image](https://github.com/dchesterton/image). Many thanks to [dchesterton](https://github.com/dchesterton)!

Supported image types:

- JPEG
- PNG
- WEBP

Supported image meta types:

- XMP
- IPTC
- EXIF

> **NOTE**: a TypeScript equivalent of this library is available [here](https://github.com/Frameright/image-display-control-metadata-parser).

Installation
------------

[](#installation)

Pull the library in your project via [Composer](https://getcomposer.org/)with the following `composer.json`:

```
{
  "minimum-stability": "dev",
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/Frameright/php-image-metadata-parser.git"
    }
  ],
  "require": {
    "frameright/image-metadata-parser": "dev-master"
  }
}
```

**Dependencies**: [`php-xml`](https://www.php.net/manual/en/book.dom.php)

Usage
-----

[](#usage)

 ✨ [Getting started](https://docs.frameright.io/php/getting-started)

 🔧 [Contributing](https://docs.frameright.io/php/contributing)

 📝 [Tutorial](https://www.frameright.io/post/metadata-in-php)

 📝 [Changelog](https://docs.frameright.io/php/changelog)

### Get metadata

[](#get-metadata)

```
$image = Image::fromFile($filename);

$headline = $image->getXmp()->getHeadline();
$camera = $image->getExif()->getCamera();
...
```

### Loading specific image type

[](#loading-specific-image-type)

When file type is known, you can load the file type directly using the file types' `fromFile` method.

```
$jpeg = JPEG::fromFile('image.jpg');
$png = PNG::fromFile('image.png');
```

### Instantiate from bytes

[](#instantiate-from-bytes)

If you don't have a file to work with but you do have the image stored in a string (from database, ImageMagick etc.) you can easily instantiate an object from the string.

```
$data = ...

$jpeg = JPEG::fromString($data);
```

### Instantiate from GD or a stream

[](#instantiate-from-gd-or-a-stream)

You can also create an object from a GD resource or a stream.

```
$gd = imagecreate(100, 100);
$jpeg = JPEG::fromResource($gd);
```

```
$stream = fopen('...', 'r+');
$jpeg = JPEG::fromStream($stream);
```

### Aggregate metadata

[](#aggregate-metadata)

When just want a piece of metadata and don't care whether it's from XMP, IPTC or EXIF, you can use the aggregate meta object.

```
$image = Image::fromFile($filename);
$headline = $image->getAggregate()->getHeadline();
```

By default it checks XMP first, then IPTC, then EXIF but you can change the priority:

```
$aggregate = $image->getAggregate();
$aggregate->setPriority(['exif', 'iptc', 'xmp']);

$aggregate->getHeadline(); // will now check EXIF first, then IPTC, then XMP
```

You can also exclude a metadata type if you do not want to use it:

```
$aggregate->setPriority(['iptc', 'xmp']);
$aggregate->getHeadline(); // will only check IPTC and XMP
```

#### Get GPS data

[](#get-gps-data)

```
$image = ...
$gps = $image->getAggregateMeta()->getGPS(); // checks EXIF and XMP
// or $gps = $image->getExif()->getGPS();

$lat = $gps->getLatitude();
```

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance43

Moderate activity, may be stable

Popularity35

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~133 days

Recently: every ~154 days

Total

7

Last Release

337d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0634af2f7f5536b9ee842ce8318ef4640b043034a9d3be704fc7f4d3fb83e9cc?d=identicon)[lourot](/maintainers/lourot)

![](https://www.gravatar.com/avatar/bb1f6ef661a37cbb5a08e1246002d35eb82e8aecafa8402e14470338d40ba199?d=identicon)[ilu](/maintainers/ilu)

---

Top Contributors

[![lourot](https://avatars.githubusercontent.com/u/11795312?v=4)](https://github.com/lourot "lourot (59 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (15 commits)")[![klaari](https://avatars.githubusercontent.com/u/2477131?v=4)](https://github.com/klaari "klaari (5 commits)")

---

Tags

framerightimageimage-display-controlimage-manipulationiptc-metadatametadatametadata-extractionmetadata-parserimagemetadataphotoexifIPTCxmpImage Display ControlIDCFrameright

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/frameright-image-metadata-parser/health.svg)

```
[![Health](https://phpackages.com/badges/frameright-image-metadata-parser/health.svg)](https://phpackages.com/packages/frameright-image-metadata-parser)
```

###  Alternatives

[fileeye/pel

PHP Exif Library. A library for reading and writing Exif headers in JPEG and TIFF images using PHP.

197.1M2](/packages/fileeye-pel)[joserick/png-metadata

A PHP library for extract the metadata (XMP, EXIF) within a PNG format image.

2234.7k](/packages/joserick-png-metadata)[causal/extractor

This extension detects and extracts metadata (EXIF / IPTC / XMP / ...) from potentially thousand different file types (such as MS Word/Powerpoint/Excel documents, PDF and images) and bring them automatically and natively to TYPO3 when uploading assets. Works with built-in PHP functions but takes advantage of Apache Tika and other external tools for enhanced metadata extraction.

16244.5k](/packages/causal-extractor)[dantsu/php-image-editor

PHP library to easily edit image with GD extension.

34152.1k2](/packages/dantsu-php-image-editor)[lychee-org/php-exif

Object-Oriented EXIF parsing

1085.0k1](/packages/lychee-org-php-exif)[carlcs/craft-assetmetadata

Asset Metadata plugin for Craft CMS

316.8k](/packages/carlcs-craft-assetmetadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
