aboutsummaryrefslogtreecommitdiff
path: root/static/js/wpaint/test/upload.php
diff options
context:
space:
mode:
authorLibravatar bai 2019-03-29 02:14:43 +0000
committerLibravatar bai 2019-03-29 02:14:43 +0000
commit95dfe14528663923ca2a88ec928f1d8d9df2402b (patch)
tree5bc88d1466957f1aa39043b056bde5c439648022 /static/js/wpaint/test/upload.php
downloadweabot-95dfe14528663923ca2a88ec928f1d8d9df2402b.tar.gz
weabot-95dfe14528663923ca2a88ec928f1d8d9df2402b.tar.xz
weabot-95dfe14528663923ca2a88ec928f1d8d9df2402b.zip
Init
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"}';