An open API service indexing awesome lists of open source software.

https://github.com/aportela/remote-thumbnail-cache-wrapper

generate & cache thumbnails of remote & local images
https://github.com/aportela/remote-thumbnail-cache-wrapper

composer-package gd jpg php php8 png thumbnail

Last synced: 7 months ago
JSON representation

generate & cache thumbnails of remote & local images

Awesome Lists containing this project

README

          

# remote-thumbnail-cache-wrapper

generate & cache thumbnails of remote & local images

## Requirements

- mininum php version 8.4
- curl extension must be enabled
- gd extension must be enabled

## Limitations

At this time only JPEG & PNG formats are supported.

## Install (composer) dependencies:

```Shell
composer require aportela/remote-thumbnail-cache-wrapper
```

## Code example (from remote picture):

```php
get();
if ($path !== false) {
header("Content-Type: image/jpeg");
readfile($path);
} else {
header("HTTP/1.1 404 Not Found");
}
```

# Code example (from local filesystem picture):

```php
get();
if ($path !== false) {
header("Content-Type: image/png");
readfile($path);
} else {
header("HTTP/1.1 404 Not Found");
}
```

![PHP Composer](https://github.com/aportela/remote-thumbnail-cache-wrapper/actions/workflows/php.yml/badge.svg)