Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ziggi/zimg-host
Simple image hosting service
https://github.com/ziggi/zimg-host
css gd hosting image image-host javascript material-design-lite php
Last synced: 14 days ago
JSON representation
Simple image hosting service
- Host: GitHub
- URL: https://github.com/ziggi/zimg-host
- Owner: ziggi
- License: mit
- Created: 2013-10-27T13:01:00.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2018-09-03T12:44:49.000Z (over 6 years ago)
- Last Synced: 2024-04-17T03:43:31.605Z (10 months ago)
- Topics: css, gd, hosting, image, image-host, javascript, material-design-lite, php
- Language: PHP
- Homepage: https://img.ziggi.org/
- Size: 520 KB
- Stars: 73
- Watchers: 10
- Forks: 18
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# zimg-host
Simple image hosting service
# Demo
http://img.ziggi.org/
# Backend requirement
- PHP >= 5.3.0
- GD extension# Installation
- Copy files into your website directory (subdirectories are supported)
- Change config.php if you need
- Make sure that the file/ directory is writable by web server# Config for nginx
If you are using nginx instead Apache, this configuration example can be useful to you:
```
location / {
try_files $uri $uri/ /index.php?$args;
}
```# Usage in CURL
You can upload images using CURL.
Some examples:
```
curl -F files[][email protected] http://img.ziggi.org/api/upload.php
curl -F files[][email protected] -F files[][email protected] http://img.ziggi.org/api/upload.php
curl -F urls[]=http://i.imgur.com/VCcArdF.jpg?1 http://img.ziggi.org/api/upload.php
curl -F urls[]=http://i.imgur.com/VCcArdF.jpg?1 -F urls[]=http://i.imgur.com/hdsdwsS.jpg?1 http://img.ziggi.org/api/upload.php
```Password protect upload:
```
curl -u whatever:YOUR_PASSWORD -F urls[]=http://i.imgur.com/VCcArdF.jpg?1 http://img.ziggi.org/api/upload.php
```example of result string (formatted for readability):
```json
[
{
"name":"image1.jpg",
"type":2,
"size":
{
"width":420,
"height":336,
"filesize":26834
},
"error":
{
"upload":0,
"type":0,
"size":0
},
"url":"mijhmyhS.jpg"
},
{
"name":"image2.jpg",
"type":2,
"size":
{
"width":703,
"height":442,
"filesize":88604
},
"error":
{
"upload":0,
"type":0,
"size":0
},
"url":"GyDIPAGC.jpg"
}
]
```