From 441eb23daf25de6b403fc490dad48bea810e47a3 Mon Sep 17 00:00:00 2001 From: Christian Haschek Date: Tue, 27 Oct 2015 17:19:33 +0100 Subject: [PATCH] Init commit --- LICENSE | 0 README.md | 25 ++++++++++++++++++++++--- backend.php | 0 classes/easyphpthumbnail.php | 0 classes/html.php | 0 classes/image.php | 0 classes/model.php | 0 classes/simpleimage.php | 0 css/imgs/Thumbs.db | Bin css/imgs/bg.png | Bin css/imgs/content.png | Bin css/imgs/footer.png | Bin css/imgs/header.png | Bin css/imgs/header_empty.png | Bin css/imgs/header_logo.png | Bin css/imgs/hs_logo.png | Bin css/main.css | 0 css/normalize.css | 0 css/pictshare.css | 0 inc/core.php | 0 index.php | 0 js/helper.js | 0 js/jquery-2.1.0.min.js | 0 js/main.js | 0 js/plugins.js | 0 js/vendor/modernizr-2.6.2.min.js | 0 js/vendor/zepto.min.js | 0 models/pictsharemodel.php | 0 template.php | 0 29 files changed, 22 insertions(+), 3 deletions(-) mode change 100755 => 100644 LICENSE mode change 100755 => 100644 README.md mode change 100755 => 100644 backend.php mode change 100755 => 100644 classes/easyphpthumbnail.php mode change 100755 => 100644 classes/html.php mode change 100755 => 100644 classes/image.php mode change 100755 => 100644 classes/model.php mode change 100755 => 100644 classes/simpleimage.php mode change 100755 => 100644 css/imgs/Thumbs.db mode change 100755 => 100644 css/imgs/bg.png mode change 100755 => 100644 css/imgs/content.png mode change 100755 => 100644 css/imgs/footer.png mode change 100755 => 100644 css/imgs/header.png mode change 100755 => 100644 css/imgs/header_empty.png mode change 100755 => 100644 css/imgs/header_logo.png mode change 100755 => 100644 css/imgs/hs_logo.png mode change 100755 => 100644 css/main.css mode change 100755 => 100644 css/normalize.css mode change 100755 => 100644 css/pictshare.css mode change 100755 => 100644 inc/core.php mode change 100755 => 100644 index.php mode change 100755 => 100644 js/helper.js mode change 100755 => 100644 js/jquery-2.1.0.min.js mode change 100755 => 100644 js/main.js mode change 100755 => 100644 js/plugins.js mode change 100755 => 100644 js/vendor/modernizr-2.6.2.min.js mode change 100755 => 100644 js/vendor/zepto.min.js mode change 100755 => 100644 models/pictsharemodel.php mode change 100755 => 100644 template.php diff --git a/LICENSE b/LICENSE old mode 100755 new mode 100644 diff --git a/README.md b/README.md old mode 100755 new mode 100644 index 78bb0ef..14ae9e4 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ If you own a server (even an home server) you can host your own PictShare instan ## Features - Uploads without logins or validation (that's a good thing, right?) -- Simple API to upload any image from remote servers to your instance via URL or base64 encoded image +- Simple API to upload any image from remote servers to your instance via URL - 100% file based - no database needed - PictShare removes all exif data so you can upload photos from your phone and all GPS tags and camera model info get wiped - Builtin and simple resizing and caching @@ -16,7 +16,22 @@ If you own a server (even an home server) you can host your own PictShare instan Lets's say you have uploaded this image: ```https://www.pictshare.net/b260e36b60.jpg``` but you want to use it as your avatar in some forum that only allows 100x100 pixel images. Instead of editing it yourself you just use ```https://www.pictshare.net/100x100/b260e36b60.jpg``` -Just by editing the URL the image gets resized and the resized version gets cached to the disk so it loads much faster. +Just by editing the URL and adding the size (in width**x**height) the image gets resized and the resized version gets cached to the disk so it loads much faster on the next request. + +## How does the API work? +PictShare has a simple REST API to upload remote pictures. The API can be accessed via the backend.php file like this: + +```https://pictshare.net/backend.php?getimage=```. + +#### Example: + +Request: ```https://pictshare.net/backend.php?getimage=https://www.0xf.at/css/imgs/logo.png``` + +The server will answer with the file name and the server path in JSON: + +``` +{"status":"OK","type":"png","hash":"10ba188162.png","url":"http:\/\/pictshare.net\/10ba188162.png"} +``` ## Security and privacy - By hosting your own images you can delete them any time you want @@ -28,5 +43,9 @@ Just by editing the URL the image gets resized and the resized version gets cach - PHP 5 GD library - Some hostname or subdomain. Site might get messed up if it's not stored in the root directory of the webserver +## Installing PictShare +- Just unpack it on your webserver (remember, pictshare needs to be in a root directory) and it should work out of the box + ## Coming soon -- Restricted uploads so you can control who may upload on your instance \ No newline at end of file +- Restricted uploads so you can control who may upload on your instance +- API upload via Base64 encoded images \ No newline at end of file diff --git a/backend.php b/backend.php old mode 100755 new mode 100644 diff --git a/classes/easyphpthumbnail.php b/classes/easyphpthumbnail.php old mode 100755 new mode 100644 diff --git a/classes/html.php b/classes/html.php old mode 100755 new mode 100644 diff --git a/classes/image.php b/classes/image.php old mode 100755 new mode 100644 diff --git a/classes/model.php b/classes/model.php old mode 100755 new mode 100644 diff --git a/classes/simpleimage.php b/classes/simpleimage.php old mode 100755 new mode 100644 diff --git a/css/imgs/Thumbs.db b/css/imgs/Thumbs.db old mode 100755 new mode 100644 diff --git a/css/imgs/bg.png b/css/imgs/bg.png old mode 100755 new mode 100644 diff --git a/css/imgs/content.png b/css/imgs/content.png old mode 100755 new mode 100644 diff --git a/css/imgs/footer.png b/css/imgs/footer.png old mode 100755 new mode 100644 diff --git a/css/imgs/header.png b/css/imgs/header.png old mode 100755 new mode 100644 diff --git a/css/imgs/header_empty.png b/css/imgs/header_empty.png old mode 100755 new mode 100644 diff --git a/css/imgs/header_logo.png b/css/imgs/header_logo.png old mode 100755 new mode 100644 diff --git a/css/imgs/hs_logo.png b/css/imgs/hs_logo.png old mode 100755 new mode 100644 diff --git a/css/main.css b/css/main.css old mode 100755 new mode 100644 diff --git a/css/normalize.css b/css/normalize.css old mode 100755 new mode 100644 diff --git a/css/pictshare.css b/css/pictshare.css old mode 100755 new mode 100644 diff --git a/inc/core.php b/inc/core.php old mode 100755 new mode 100644 diff --git a/index.php b/index.php old mode 100755 new mode 100644 diff --git a/js/helper.js b/js/helper.js old mode 100755 new mode 100644 diff --git a/js/jquery-2.1.0.min.js b/js/jquery-2.1.0.min.js old mode 100755 new mode 100644 diff --git a/js/main.js b/js/main.js old mode 100755 new mode 100644 diff --git a/js/plugins.js b/js/plugins.js old mode 100755 new mode 100644 diff --git a/js/vendor/modernizr-2.6.2.min.js b/js/vendor/modernizr-2.6.2.min.js old mode 100755 new mode 100644 diff --git a/js/vendor/zepto.min.js b/js/vendor/zepto.min.js old mode 100755 new mode 100644 diff --git a/models/pictsharemodel.php b/models/pictsharemodel.php old mode 100755 new mode 100644 diff --git a/template.php b/template.php old mode 100755 new mode 100644