PHPackages                             mykemeynell/filepreview - 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. mykemeynell/filepreview

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

mykemeynell/filepreview
=======================

Library for generating file previews.

v1.0.1(6y ago)06PHP

Since Mar 2Pushed 6y agoCompare

[ Source](https://github.com/mykemeynell/FilePreview)[ Packagist](https://packagist.org/packages/mykemeynell/filepreview)[ RSS](/packages/mykemeynell-filepreview/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (5)Versions (4)Used By (0)

FilePreview
===========

[](#filepreview)

Generate preview images for file types.

Installation with Composer
--------------------------

[](#installation-with-composer)

`composer require mykemeynell/filepreview`

Usage
-----

[](#usage)

```
$fileName = '/path/to/file.pdf';
$preview = mykemeynell\FilePreview\FilePreview::fromPath($fileName);

echo $preview->preview()->stream();
```

`FilePreview::preview()`

Actions the conversion and prepares headers for output.

`FilePreview::stream()`

Sets appropriate headers prepared in `FilePreview::stream()` and outputs the content.

Custom Handlers
---------------

[](#custom-handlers)

If you wish to change how MIME types are handled, then you can use the `FilePreview::addHandler($mime, $handler)` method.

`$handler` can accept two parameters

- \[Parameter 0\] Instance of `FilePreview`.
- \[Parameter 1\] Instance of `mykemeynell\FilePreview\FileSystem\File::class`relating to the given file path.

```
FilePreview::addHandler('application/pdf', function ($preview, $file) {
    /** @var \mykemeynell\FilePreview\FilePreview $preview */
    /** @var \mykemeynell\FilePreview\FileSystem\File $file */

    // $content = ...=

    $preview->setContentTypeHeader('image/jpg');
    $preview->setContent($content);

    return $preview;
});
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

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

Every ~0 days

Total

2

Last Release

2259d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/494de8188ad97403b72e40e385235a74ef6331aa2710b3727193f646189af9fc?d=identicon)[mykemeynell](/maintainers/mykemeynell)

---

Top Contributors

[![mykemeynell](https://avatars.githubusercontent.com/u/1590190?v=4)](https://github.com/mykemeynell "mykemeynell (5 commits)")

### Embed Badge

![Health badge](/badges/mykemeynell-filepreview/health.svg)

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

###  Alternatives

[laravel/framework

The Laravel Framework.

34.6k509.9M17.0k](/packages/laravel-framework)[prestashop/prestashop

PrestaShop is an Open Source e-commerce platform, committed to providing the best shopping cart experience for both merchants and customers.

9.0k15.4k](/packages/prestashop-prestashop)[bkwld/croppa

Image thumbnail creation through specially formatted URLs for Laravel

510496.0k22](/packages/bkwld-croppa)[ec-cube/ec-cube

EC-CUBE EC open platform.

78527.0k1](/packages/ec-cube-ec-cube)[civicrm/civicrm-core

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

728272.9k17](/packages/civicrm-civicrm-core)[trntv/yii2-glide

Yii2 Glide Extension

41269.5k9](/packages/trntv-yii2-glide)

PHPackages © 2026

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