Browse Source

Merge f0cfe3a54f into 6075298162

pull/632/merge
vineet kumar 6 years ago
committed by GitHub
parent
commit
08f27693f7
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      src/js/pannellum.js

+ 7
- 3
src/js/pannellum.js View File

@@ -397,7 +397,7 @@ function init() {
anError(config.strings.fileAccessError.replace('%s', a.outerHTML)); anError(config.strings.fileAccessError.replace('%s', a.outerHTML));
} }
var img = this.response; var img = this.response;
parseGPanoXMP(img);
parseGPanoXMP(img, p);
infoDisplay.load.msg.innerHTML = ''; infoDisplay.load.msg.innerHTML = '';
}; };
xhr.onprogress = function(e) { xhr.onprogress = function(e) {
@@ -516,7 +516,7 @@ function onImageLoad() {
* @private * @private
* @param {Image} image - Image to read XMP metadata from. * @param {Image} image - Image to read XMP metadata from.
*/ */
function parseGPanoXMP(image) {
function parseGPanoXMP(image, imageUrl) {
var reader = new FileReader(); var reader = new FileReader();
reader.addEventListener('loadend', function() { reader.addEventListener('loadend', function() {
var img = reader.result; var img = reader.result;
@@ -591,7 +591,11 @@ function parseGPanoXMP(image) {
} }
// Load panorama // Load panorama
panoImage.src = window.URL.createObjectURL(image);
// panoImage.src = window.URL.createObjectURL(image);
panoImage.src = imageUrl;
//if site has security content policy for src/data-src - http/https/data, then blob url gives error
//so instead of blob url we can directly set url here
panoImage.crossOrigin = "Anonymous"; //We don't want cors here.
}); });
if (reader.readAsBinaryString !== undefined) if (reader.readAsBinaryString !== undefined)
reader.readAsBinaryString(image); reader.readAsBinaryString(image);


Loading…
Cancel
Save