How to Base64 encode your images
Posted on March 4, 2012
If you want to create a thumbnail through ajax with jquery and json. you can let php return an base64 encoded image.
$img_src = "img/sample.jpg";
$imgbinary = file_get_contents($img_src);
$img_str = base64_encode($imgbinary);
echo '';