I am trying to get image in Base64 format outside of 

```
var codedPic;
var purl = 'http://upload.wikimedia.org/wikipedia/commons/4/4a/Logo_2013_Google.png';

var codedPic = convertImgToBase64(purl, function(base64Img){ console.log('attempt 1: ' + base64Img); });

console.log('attempt 2: ' + codedPic);

```

It is getting results of attempt 1 but for attempt 2 it displays undefined. But I need it working too. Can anyone help me please?

Please feel free to amend this jsfiddle: <http://jsfiddle.net/s7x0otdc/2/>