Alternative approach I discovered
Retrieving image in base64 format using a web service
Utilizing a web service
<?php
header("access-control-allow-origin: *");
if($_GET['key']=='1453'){
try {
$path = $_GET['url'];
$type = pathinfo($path, PATHINFO_EXTENSION);
$data = file_get_contents($path);
$base64 = 'data:image/' . $type . ';base64,' . base64_encode($data);
echo $base64;
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
}else{
echo 404;
}
Implementation with three.js
var image = new Image();
image.src = data;//base64 type image from web service
var texture = new THREE.Texture();
texture.image = image;
image.onload = function() {
texture.needsUpdate = true;
};
var material = new THREE.MeshPhongMaterial({
map: texture,
});