im trying to send image to a webservice in php using json, but the client cnt read the image.. when i return it back!!
<?php
//recieve the image
$media = json_decode($_POST['media']);
header('content-type: image/jpeg');
$image = imagecreatefromjpeg($media);
imagefilter($image,IMG_FILTER_GRAYSCALE);
imagefilter($image,IMG_FILTER_COLORIZE,100,50,0);
imagejpeg($image, '', 90);
imagedestroy($image);
//return image
$response = array(
'image' => $image
);
echo json_encode($response);
?>
from the code, is there anything I'm doing wrong? Thanks!!! :))