PHPackages                             matula/firstimg - 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. matula/firstimg

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

matula/firstimg
===============

Get the first image from a web page

v1.0.0(11y ago)016PHPPHP &gt;=5.4.0

Since Aug 4Pushed 11y agoCompare

[ Source](https://github.com/matula/firstimg)[ Packagist](https://packagist.org/packages/matula/firstimg)[ RSS](/packages/matula-firstimg/feed)WikiDiscussions master Synced yesterday

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

First Image
===========

[](#first-image)

---

Simple library that returns the first image on a web page. Though, only if it's in an `` tag.

### Installation

[](#installation)

Add to your composer.json file

```
"matula/firstimg": "dev-master"

```

### Usage

[](#usage)

```
$url = 'http://google.com';
$image = new Matula\Firstimg\Firstimg($url);
echo $image->downloadImage();

```

This will find the first image on the page and download it. Currently, it also resizes the image to 100px.

### TODO

[](#todo)

- better documentation
- customize the image's filename/extension
- customize image resizing, or disable
- better formatting, etc

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

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

Unknown

Total

1

Last Release

4353d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/74b80305f00a721b4fd9b1246d7667d461215e77f19a424b49fe89ca0eb581a0?d=identicon)[matula](/maintainers/matula)

---

Top Contributors

[![matula](https://avatars.githubusercontent.com/u/429870?v=4)](https://github.com/matula "matula (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matula-firstimg/health.svg)

```
[![Health](https://phpackages.com/badges/matula-firstimg/health.svg)](https://phpackages.com/packages/matula-firstimg)
```

###  Alternatives

[spatie/laravel-export

Create a static site bundle from a Laravel app

674146.0k6](/packages/spatie-laravel-export)[blackfire/player

A powerful web crawler and web scraper with Blackfire support

49617.1k](/packages/blackfire-player)[symfony/ux-cropperjs

Cropper.js integration for Symfony

19346.6k3](/packages/symfony-ux-cropperjs)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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