Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stefanhuber/fakeimage
Generate fake images for testing or as placeholders
https://github.com/stefanhuber/fakeimage
faker faker-generator faker-image
Last synced: about 1 month ago
JSON representation
Generate fake images for testing or as placeholders
- Host: GitHub
- URL: https://github.com/stefanhuber/fakeimage
- Owner: stefanhuber
- Created: 2021-12-20T11:24:44.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-04T21:37:27.000Z (about 2 years ago)
- Last Synced: 2024-04-14T22:45:44.019Z (7 months ago)
- Topics: faker, faker-generator, faker-image
- Language: PHP
- Homepage:
- Size: 105 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# FakeImage
> Generate fake images for testing or as placeholders
## API
### Random Generator
Generate a random image with the following URL:
```
/random-{width}-{height}-{tile}.{extension}
```| Param | Optional | Description |
| --- | --- | --- |
| width | | width in pixels |
| height | x | height in pixels, if omitted width is used to produce square image |
| tile | x | tile size of random colors in generated image, 5 is default value |
| extension | x | png, jpg, jpeg or gif is supported |#### Examples
##### /random-400x300.jpg
![/random-400x300.jpg](./docs/random-400x300.jpg)
##### /random-400x300x25.jpg
![/random-400x300x25.jpg](./docs/random-400x300x25.jpg)
##### /random-200.jpg
![/random-400x300.jpg](./docs/random-200.jpg)
## Run
### Local PHP webserver
```
composer install
php -S localhost:9000 -t ./public ./config/server.php
```### Docker
```
docker run -it --rm -p 9000:9000 stefanhuber/fakeimage
```