aboutsummaryrefslogtreecommitdiff
path: root/static/js/wpaint/test/upload.php
blob: f0187b5965641a637b850b05b78c2240d3005819 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
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"}';