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 1mo ago

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 37% 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

4304d 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

[laravolt/avatar

Turn name, email, and any other string into initial-based avatar or gravatar.

2.0k5.4M31](/packages/laravolt-avatar)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[ashallendesign/favicon-fetcher

A Laravel package for fetching website's favicons.

190272.4k3](/packages/ashallendesign-favicon-fetcher)[beyondcode/laravel-favicon

Create dynamic favicons based on your environment settings.

37345.5k](/packages/beyondcode-laravel-favicon)[helgesverre/extractor

AI-Powered Data Extraction for your Laravel application.

22128.0k](/packages/helgesverre-extractor)[flarum/core

Delightfully simple forum software.

211.3M1.9k](/packages/flarum-core)

PHPackages © 2026

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