https://github.com/petesteege/imageapi
An API / web gui for docker that uses html as a template to render down to an image.
https://github.com/petesteege/imageapi
api artwork coverart docker docker-compose html image-generator json music php
Last synced: 3 months ago
JSON representation
An API / web gui for docker that uses html as a template to render down to an image.
- Host: GitHub
- URL: https://github.com/petesteege/imageapi
- Owner: petesteege
- License: gpl-3.0
- Created: 2024-10-23T14:57:49.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-23T19:35:53.000Z (over 1 year ago)
- Last Synced: 2024-11-05T14:37:22.692Z (over 1 year ago)
- Topics: api, artwork, coverart, docker, docker-compose, html, image-generator, json, music, php
- Language: JavaScript
- Homepage: https://petesteege.com/devlopment/imageapi
- Size: 287 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# imageapi
Note: This is still a working progress but mostly there.
An API / web gui for docker that uses html as a template to render down to an image.
Can be used for Music Cover art generation / banners etc.
1. Setup your environment variables in the .env file, and install using the docker-compose.yml, this creates two containers, the API and a web GUI.
2. create an html template in the gui or upload one via the API (i think that works).
3 in the template add any api variables you wish to send to you template using - {{my_api_var}}.
{{album_id}}
then in the API you can send this variable -
https://api.myserver.com/api/make_image?{=&album_id=My Great Album&}
or as JSON -
e.g. -
{
"template_id": "2",
"width": 1400,
"height": 1400,
"data":{"artist_name": "Bob",
"track_title": "McBobface",
"back_url": "null",
"artworkcopy": "Image (c) courtesy of someone with a camera",
"release_date": "produciton date",
"font_col": "%23FFFFFF",
"back_col": "%23FFFFFF",
"track_col": "%23FFFFFF",
"album_id": "34786259",
"copyright":"Copyright (c) McBobface Music, . All rights reserved."
}
}
API auth
Header - X-API-Key:
4. click download image button (if using the GUI) or the API should return the following JSON -
{
"status": "success",
"file_url": "https://api.myserver.com/output/1f4c8db8-a604-4daa-bf2d-9548d35a1f78.png"
}
Any questions (or improvements) get in touch. As i say, this is still a working progress :)
endpoints available /docs
# Screenshot
