PHPackages                             marc1706/fast-image-size - 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. marc1706/fast-image-size

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

marc1706/fast-image-size
========================

fast-image-size is a PHP library that does almost everything PHP's getimagesize() does but without the large overhead of downloading the complete file.

v1.3.0(1mo ago)959.4M—8%22[2 issues](https://github.com/marc1706/fast-image-size/issues)[1 PRs](https://github.com/marc1706/fast-image-size/pulls)20MITPHPPHP &gt;=7.2CI passing

Since Apr 7Pushed 1mo ago6 watchersCompare

[ Source](https://github.com/marc1706/fast-image-size)[ Packagist](https://packagist.org/packages/marc1706/fast-image-size)[ Docs](https://www.m-a-styles.de)[ RSS](/packages/marc1706-fast-image-size/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (2)Versions (22)Used By (20)

fast-image-size library
=======================

[](#fast-image-size-library)

### About

[](#about)

fast-image-size is a PHP library that does almost everything PHP's getimagesize() does but without the large overhead of downloading the complete file.

It currently supports the following image types:

- BMP
- GIF
- ICO
- IFF
- JPEG 2000
- JPEG
- PNG
- PSD
- TIF/TIFF
- WBMP
- WebP

### Requirements

[](#requirements)

PHP 7.2.0 or newer is required for this library to work.

### Installation

[](#installation)

It is recommend to install the library using composer. Just add the following snippet to your composer.json:

```
  "require": {
    "marc1706/fast-image-size": "^1.3"
  },

```

### Usage

[](#usage)

Using the fast-image-size library is rather straightforward. Just create a new instance of the main class:

```
$FastImageSize = new \FastImageSize\FastImageSize();

```

Afterwards, you can check images using the getImageSize() method:

```
$imageSize = $FastImageSize->getImageSize('https://example.com/some_random_image.jpg');

```

You can pass any local or remote image to this library as long as it's readable.

If the library is able to determine the image size, it will return an array with the following structure (values and type might of course differ depending on your image):

```
$imageSize = array(
	'width' => 16,
	'height' => 16,
	'type' => IMAGETYPE_PNG,
);

```

### Configuration

[](#configuration)

You can set stream context options using the `setStreamContextOptions()` method. This allows you to customize the request, for example by setting a timeout for remote images:

```
$imageSize->setStreamContextOptions([
	'http' => [
		'timeout' => 5.0,
	],
]);

```

### Automated Tests

[](#automated-tests)

The library is being tested using unit tests to prevent possible issues.

[![CI](https://github.com/marc1706/fast-image-size/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/marc1706/fast-image-size/actions/workflows/ci.yml)[![Code Coverage](https://camo.githubusercontent.com/5a132e169b13f8ba153fc71d37c7cff53d550ce939b3d3c9f8da1a6b805a06f6/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d617263313730362f666173742d696d6167652d73697a652f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/marc1706/fast-image-size/?branch=master)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e8122d73e2d12ddccce21bb4ed4bf09c908562010d154af9556b222121ac903c/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6d617263313730362f666173742d696d6167652d73697a652f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/marc1706/fast-image-size/?branch=master)

### License

[](#license)

[The MIT License (MIT)](http://opensource.org/licenses/MIT)

### Credits

[](#credits)

Sample files of WebP format by Google: [WebP Image Galleries](https://developers.google.com/speed/webp/gallery)

###  Health Score

65

—

FairBetter than 99% of packages

Maintenance89

Actively maintained with recent releases

Popularity59

Moderate usage in the ecosystem

Community31

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 96.1% 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 ~307 days

Recently: every ~574 days

Total

14

Last Release

57d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v1.2.0PHP &gt;=7.2

### Community

Maintainers

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

---

Top Contributors

[![marc1706](https://avatars.githubusercontent.com/u/394418?v=4)](https://github.com/marc1706 "marc1706 (147 commits)")[![Alexkurd](https://avatars.githubusercontent.com/u/7689609?v=4)](https://github.com/Alexkurd "Alexkurd (2 commits)")[![danielhanold](https://avatars.githubusercontent.com/u/580920?v=4)](https://github.com/danielhanold "danielhanold (1 commits)")[![JoshyPHP](https://avatars.githubusercontent.com/u/317712?v=4)](https://github.com/JoshyPHP "JoshyPHP (1 commits)")[![keulinho](https://avatars.githubusercontent.com/u/15930605?v=4)](https://github.com/keulinho "keulinho (1 commits)")[![pierreuh](https://avatars.githubusercontent.com/u/6187845?v=4)](https://github.com/pierreuh "pierreuh (1 commits)")

---

Tags

phpimagefastsizegetimagesizeimagesize

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/marc1706-fast-image-size/health.svg)

```
[![Health](https://phpackages.com/badges/marc1706-fast-image-size/health.svg)](https://phpackages.com/packages/marc1706-fast-image-size)
```

###  Alternatives

[dantsu/php-image-editor

PHP library to easily edit image with GD extension.

34152.1k2](/packages/dantsu-php-image-editor)[lciolecki/php-image-optimizer

PHP image file optimizer (uses https://github.com/bensquire/php-image-optim)

347.4k](/packages/lciolecki-php-image-optimizer)

PHPackages © 2026

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