Advertisement
urutehe1

FunctionGray

Apr 8th, 2019
1,421
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function grayscale() {
  2.     $('#progress').show();
  3.     $.ajax({
  4.         type: 'POST',
  5.         url: 'function/grayscale.php',
  6.         data: {
  7.             r: JSON.stringify(edited.r),
  8.             g: JSON.stringify(edited.g),
  9.             b: JSON.stringify(edited.b),
  10.             width: edited.width,
  11.             height: edited.height
  12.         },
  13.         success: function(data) {
  14.             data = JSON.parse(data);
  15.             $('#edit-image').attr('src', data.base64);
  16.             $('#progress').hide();
  17.             edited.r = data.r;
  18.             edited.g = data.g;
  19.             edited.b = data.b;
  20.             edited.width = parseInt(data.width);
  21.             edited.height = parseInt(data.height);
  22.         },
  23.         async: false
  24.     });
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement