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
- Host: GitHub
- URL: https://github.com/aportela/remote-thumbnail-cache-wrapper
- Owner: aportela
- License: agpl-3.0
- Created: 2022-04-24T21:28:06.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-01-03T08:32:24.000Z (over 2 years ago)
- Last Synced: 2025-01-02T22:18:39.230Z (over 1 year ago)
- Topics: composer-package, gd, jpg, php, php8, png, thumbnail
- Language: PHP
- Homepage:
- Size: 74.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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");
}
```
