Looks like it is impossible to do anything helpful with image before it is on my server, so I have this script which creates a temporary copy of the image on my host:
$content = file_get_contents("http://cs6045.vk.me/v6045344/43ce/D7BD4GsCmG4.jpg"); file_put_contents("image.png",$content);
There seems tho to be some issues between the browsers, since they process image data differentely. If you want 100% the same Base64 encoding as your PHP-script, I suggest you simply make an AJAX-call to the script, which processes the image. Then it returns the Base64 string.