From c66d1fff67c0c8cd834150285bb81e32ed5bb563 Mon Sep 17 00:00:00 2001 From: Matthew Petroff Date: Sat, 16 May 2015 01:17:11 -0400 Subject: [PATCH] Fix bug that caused compass to be displayed for images with GPano data but no heading. --- src/js/pannellum.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/js/pannellum.js b/src/js/pannellum.js index e6de881..87f20fe 100644 --- a/src/js/pannellum.js +++ b/src/js/pannellum.js @@ -384,11 +384,11 @@ function parseGPanoXMP(image) { // Extract the requested tag from the XMP data var getTag = function(tag) { - var result = xmpData.substring(xmpData.indexOf(tag + '="') + tag.length + 2); - result = result.substring(0, result.indexOf('"')); - if (result.length === 0) { + if (xmpData.indexOf(tag + '="') < 0) { return null; } + var result = xmpData.substring(xmpData.indexOf(tag + '="') + tag.length + 2); + result = result.substring(0, result.indexOf('"')); return Number(result); };