I am trying to display tiff image in the browser but it is not working when I am trying to read locally or if I am giving URL of any tiff image. Here is my code .
<script type="text/javascript">
var xhr = new XMLHttpRequest();
xhr.responseType = 'arraybuffer';
xhr.open('GET', " file:///home/aniketshivamtiwari/Desktop/tiffdocument.tif");
xhr.onload = function (e) {
var tiff = new Tiff({buffer: xhr.response});
var canvas = tiff.toCanvas();
document.body.append(canvas);
};
xhr.send();
</script>
I am getting this error
XMLHttpRequest cannot load file:///home/aniketshivamtiwari/Desktop/tiffdocument.tif. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https.
(anonymous) @ (index):54