PHPackages                             tsmgeek/exif-tool\_php\_stayopen - 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. tsmgeek/exif-tool\_php\_stayopen

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

tsmgeek/exif-tool\_php\_stayopen
================================

PHP ultra-fast library to allow accessing the ExifTool

313.7k6PHP

Since Sep 11Pushed 7y ago3 watchersCompare

[ Source](https://github.com/tsmgeek/ExifTool_PHP_Stayopen)[ Packagist](https://packagist.org/packages/tsmgeek/exif-tool_php_stayopen)[ RSS](/packages/tsmgeek-exif-tool-php-stayopen/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

ExifTool\_PHP\_Stayopen
=======================

[](#exiftool_php_stayopen)

Ive created a script that can be used to run ExifTool in StayOpen mode within PHP. The script can be inited as a singleton or instance. Ive also supplied two additional scripts that wrap the class ready for use with gearman for scaleout. The class does not apply any logic to the parameters supplied to ExifTool, what you push though gets passed though and the result is then returned. The class detects if ExifTool has died and restarts it on the next call.

It still has some work to do and cleaning up but seems to work well in my environment and scales out quite nicely. Originally I was using PHP streams but this proved to be a problem so instead using fgets to parse the return. Note that script is hard coded to work with 9.03+ of ExifTool only because this is all I have been testing against since.

Let me know what you think or any changes to make it better.

Phil Harvey's Exiftool -

Phil Harvey's Exiftool (Forum Dev Post) -

Performance tests
-----------------

[](#performance-tests)

These figures are to be taken as a guide of performance increase possible with supplied scripts but will vary depending on your hardware setup and arguments supplied to ExifTool (test system was running on ESXi/Opteron 2435/4vCPU/2G)

100 iterations fetching metadata from a JPEG (-use MWG -g -j -all:all)
1 GM Instance - 1.3s
2 GM Instances - 0.9s
3 GM Instances - 0.7s
4 GM Instances - 0.6s

300 iterations with 4 GM Instances - 1.6s
100 iterations 3 files on each iteration with 4 GM Instances - 1.4s
50 iterations 6 files on each iteration with 4 GM Instances - 1.1s
100 iterations 10 files on each iteration with 4 GM Instances - 3.1s

Usage
-----

[](#usage)

Below is a basic example on how to use this class. Put all your commands in an array and push it into the stack using the `$exif->add()` function, you can add multiple jobs to process before calling `fetch()`/`fetchAll()`.

`getInstance()` setup class as a singleton
`setExifToolPath($path)` set/change the path of ExifTool if not supplied at start
`setIdleTimeout($timeout)` idle seconds until ExifTool process is terminated
`setProcessTimeout($timeout)` total ExifTool running seconds until process is terminated
`close()` terminate ExifTool background process
`start()` start ExifTool background process
`test()` to check if ExifTool is running.
`clear()` clear the stack
`fetch()` will return one processed item off the stack at a time.
`fetchAll()` will return a single array with all items in the stack processed.
`fetchDecoded($assoc)` will return one processed item off the stack at a time with JSON output decoded.
`fetchAllDecoded($assoc)` will return a single array with all items in the stack processed and JSON output decoded.
`fetchCallback($callback)` will return one processed item via user callback off the stack at a time .
`fetchAllCallback($callback)` will return a single array with all items in the stack processed after processing via user callback.
`getError($id)` will return FALSE or STDERR output if there was an error, pass index if `fetchAll()` was used
`getErrorStr($id)` will return STDERR output, pass index if `fetchAll()` was used
`getSummary(msg)` will return summary value from msg passed which are defined as const's

As you fetch items they are taken off the stack.

Examples
--------

[](#examples)

Simple request to get all image metadata

```
$data=array('-*:*','test1.jpg');
$exif = \Exiftool\ExifToolBatch::getInstance("/path/to/exiftool");
$exif->add($data);
$result=$exif->fetchAll();
```

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 84.4% 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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5859988?v=4)[Ricardo](/maintainers/tsmgeek)[@tsmgeek](https://github.com/tsmgeek)

---

Top Contributors

[![tsmgeek](https://avatars.githubusercontent.com/u/5859988?v=4)](https://github.com/tsmgeek "tsmgeek (27 commits)")[![speich](https://avatars.githubusercontent.com/u/649653?v=4)](https://github.com/speich "speich (3 commits)")[![mkardakov](https://avatars.githubusercontent.com/u/17139095?v=4)](https://github.com/mkardakov "mkardakov (2 commits)")

### Embed Badge

![Health badge](/badges/tsmgeek-exif-tool-php-stayopen/health.svg)

```
[![Health](https://phpackages.com/badges/tsmgeek-exif-tool-php-stayopen/health.svg)](https://phpackages.com/packages/tsmgeek-exif-tool-php-stayopen)
```

###  Alternatives

[symfony/proxy-manager-bridge

Provides integration for ProxyManager with various Symfony components

761109.9M299](/packages/symfony-proxy-manager-bridge)[spaggel/tooltip

Product attribute tooltips module for Magento 2

2433.2k](/packages/spaggel-tooltip)

PHPackages © 2026

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