From c87ba5087ced0473c64d2eaaa0001f6361024e7c Mon Sep 17 00:00:00 2001 From: Mikael Roos Date: Fri, 8 May 2015 09:58:32 +0200 Subject: [PATCH] compare deal with images leaving no json information --- webroot/compare/compare.php | 4 ++++ webroot/js/cimage.js | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/webroot/compare/compare.php b/webroot/compare/compare.php index 98c078a..f52ea55 100644 --- a/webroot/compare/compare.php +++ b/webroot/compare/compare.php @@ -32,6 +32,10 @@ input[type=text] { background-color: #fff; } +.json { + min-height: 100px; +} + .top { z-index: 10; } diff --git a/webroot/js/cimage.js b/webroot/js/cimage.js index 6aa2b7b..8d736e0 100644 --- a/webroot/js/cimage.js +++ b/webroot/js/cimage.js @@ -60,7 +60,11 @@ window.CImage = (function(){ $.getJSON(this.value + "&json", function(data) { json.innerHTML = "filename: " + data.filename + "\ncolors: " + data.colors + "\nsize: " + data.size + "\nwidth: " + data.width + "\nheigh: " + data.height + "\naspect-ratio: " + data.aspectRatio; - }); + }) + .fail(function() { + json.innerHTML = "Details not available." + console.log( "JSON error" ); + }); // Display image in overlay button.removeAttribute("disabled");