aboutsummaryrefslogtreecommitdiff
path: root/static/js/wpaint/test/upload.php
diff options
context:
space:
mode:
Diffstat (limited to 'static/js/wpaint/test/upload.php')
-rw-r--r--static/js/wpaint/test/upload.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/static/js/wpaint/test/upload.php b/static/js/wpaint/test/upload.php
new file mode 100644
index 0000000..f0187b5
--- /dev/null
+++ b/static/js/wpaint/test/upload.php
@@ -0,0 +1,11 @@
+<?php
+
+$image = imagecreatefrompng($_POST['image']);
+$id = uniqid();
+
+imagealphablending($image, false);
+imagesavealpha($image, true);
+imagepng($image, 'uploads/wPaint-' . $id . '.png');
+
+// return image path
+echo '{"img": "/test/uploads/wPaint-' . $id . '.png"}';