PHPackages                             1tomany/exif-tools - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. 1tomany/exif-tools

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

1tomany/exif-tools
==================

A simple, no dependency PHP library that makes working with EXIF data easier

v0.0.9(3w ago)9661MITPHPPHP &gt;=8.4

Since Jan 20Pushed 3w agoCompare

[ Source](https://github.com/1tomany/exif-tools)[ Packagist](https://packagist.org/packages/1tomany/exif-tools)[ RSS](/packages/1tomany-exif-tools/feed)WikiDiscussions master Synced today

READMEChangelog (8)Dependencies (6)Versions (9)Used By (0)

EXIF Reader for PHP
===================

[](#exif-reader-for-php)

This simple library makes it easy to read EXIF data from JPEG and TIFF files. It handles NUL-bytes correctly and automatically converts GPS coordinates to floating point numbers.

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

[](#installation)

```
composer require 1tomany/exif-tools

```

Usage
-----

[](#usage)

Using the library is simple:

```
require_once __DIR__.'/vendor/autoload.php';

use OneToMany\Reader\ExifTagReader;

// $exifTags is an ExifMap object
$exifTags = new ExifTagReader()->read('/path/to/photo.jpeg');

var_dump($exifTags->has('FileName')); // bool(true)
var_dump($exifTags->get('FileName')->value()); // string(10) "photo.jpeg"

// Iterate over the tags
foreach ($exifTags as $tag => $value) {
    printf("%s: %s\n", $tag, $value);
}
```

Behind the scenes, each EXIF tag value is an object of type `ExifValue`. The `ExifValue` object can represent an integer, a string, an `ExifList`, or an `ExifMap`. Each element of an `ExifList` and `ExifMap` object is also an `ExifValue` object.

### Timestamps

[](#timestamps)

`ExifMap` objects have a method named `capturedAt()` that attempts to create a `\DateTimeImmutable` object that best represents when the photo was taken. In order, it analyzes the following tags: `DateTimeOriginal`, `DateTimeDigitized`, and `DateTime`. The first tag that creates a valid `\DateTimeImmutable` object is returned as the captured date.

Additionally, `ExifMap` objects have a method named `getTimestamp(string $tag)` that will attempt to convert any tag to a `\DateTimeImmutable` object. Only integer and string `ExifValue` objects are considered - lists and maps will always return `null`.

### GPS Coordinates

[](#gps-coordinates)

`ExifMap` objects have a method named `gps()` that will attempt to read the `GPSLatitude`, `GPSLatitudeRef`, `GPSLongitude`, `GPSLongitudeRef`, `GPSAltitude`, and `GPSAltitudeRef` tags and convert them to their floating point equivalents. The `gps()` method returns an object of type `GpsValue`. The `GpsValue` object has three properties:

- `?float $latitude`
- `?float $longitude`
- `?float $altitude`

These properties will be a non-null floating point number if the value was found in the EXIF tag. A positive `$altitude` represents the altitude in meters above sealevel, and a negative `$altitude` represents the same below sealevel.

### Binary Conversion

[](#binary-conversion)

Some EXIF tags store data encoded as binary bytes. For example, the tag `ComponentsConfiguration` stores a list of numbers as a NUL-terminated string. This library will unpack any control characters and convert them to their integer or list equivalents so the data can be safely encoded as JSON and stored in a database as text.

Credits
-------

[](#credits)

- [Vic Cherubini](https://github.com/viccherubini), [1:N Labs, LLC](https://1tomany.com)

License
-------

[](#license)

The MIT License

###  Health Score

45

↑

FairBetter than 91% of packages

Maintenance95

Actively maintained with recent releases

Popularity19

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.9% 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 ~20 days

Recently: every ~34 days

Total

8

Last Release

22d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/60762?v=4)[Vic Cherubini](/maintainers/viccherubini)[@viccherubini](https://github.com/viccherubini)

---

Top Contributors

[![viccherubini](https://avatars.githubusercontent.com/u/60762?v=4)](https://github.com/viccherubini "viccherubini (92 commits)")[![clementmas](https://avatars.githubusercontent.com/u/8032241?v=4)](https://github.com/clementmas "clementmas (1 commits)")

---

Tags

gpsexifexif coordinatesexif gpsexif latitudeexif longitudeexif readexif reader

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/1tomany-exif-tools/health.svg)

```
[![Health](https://phpackages.com/badges/1tomany-exif-tools/health.svg)](https://phpackages.com/packages/1tomany-exif-tools)
```

###  Alternatives

[mjaschen/phpgeo

Simple Yet Powerful Geo Library

1.6k9.3M28](/packages/mjaschen-phpgeo)[ballen/distical

A distance (Lat/Long) calculation library for PHP

40199.2k2](/packages/ballen-distical)[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.

16261.9k](/packages/causal-extractor)[vojtech-dobes/nette-forms-gpspicker

Google Maps based picker of coordinates for Nette Framework.

2457.2k](/packages/vojtech-dobes-nette-forms-gpspicker)[neos/metadata-extractor

Extracts meta data from files into a neos/metadata data structure

103.5k1](/packages/neos-metadata-extractor)

PHPackages © 2026

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