Skip to content

Commit

Permalink
check data['@id'] present
Browse files Browse the repository at this point in the history
  • Loading branch information
edsilv committed Dec 5, 2016
1 parent f5b8877 commit 9352a1f
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "manifesto",
"version": "2.0.4",
"version": "2.0.5",
"homepage": "https://github.com/edsilv/manifesto",
"authors": [
"edsilv <[email protected]>"
Expand Down
2 changes: 1 addition & 1 deletion dist/client/manifesto.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ var Manifesto;
var width = w;
var size;
// if an info.json has been loaded
if (this.externalResource && this.externalResource.data) {
if (this.externalResource && this.externalResource.data && this.externalResource.data['@id']) {
id = this.externalResource.data['@id'];
if (!width) {
width = this.externalResource.data.width;
Expand Down
4 changes: 2 additions & 2 deletions dist/client/manifesto.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// manifesto.js v2.0.4 https://github.com/viewdir/manifesto
// manifesto.js v2.0.5 https://github.com/viewdir/manifesto
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.manifesto = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
(function (global){
var Manifesto;
Expand Down Expand Up @@ -661,7 +661,7 @@ var Manifesto;
var width = w;
var size;
// if an info.json has been loaded
if (this.externalResource && this.externalResource.data) {
if (this.externalResource && this.externalResource.data && this.externalResource.data['@id']) {
id = this.externalResource.data['@id'];
if (!width) {
width = this.externalResource.data.width;
Expand Down
6 changes: 3 additions & 3 deletions dist/client/manifesto.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/manifesto.bundle.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// manifesto.js v2.0.4 https://github.com/viewdir/manifesto
// manifesto.js v2.0.5 https://github.com/viewdir/manifesto
declare module exjs {
}
declare module exjs {
Expand Down
2 changes: 1 addition & 1 deletion dist/manifesto.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// manifesto.js v2.0.4 https://github.com/viewdir/manifesto
// manifesto.js v2.0.5 https://github.com/viewdir/manifesto
declare module Manifesto {
class StringValue {
value: string;
Expand Down
4 changes: 2 additions & 2 deletions dist/server/manifesto.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/server/manifesto.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "manifesto.js",
"version": "2.0.4",
"version": "2.0.5",
"description": "IIIF Presentation API utility library for client and server",
"main": "dist/server/manifesto.js",
"scripts": {
Expand Down
8 changes: 4 additions & 4 deletions src/Canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ module Manifesto {
var size: string;

// if an info.json has been loaded
if (this.externalResource && this.externalResource.data) {
if (this.externalResource && this.externalResource.data && this.externalResource.data['@id']) {
id = this.externalResource.data['@id'];

if (!width) {
Expand All @@ -45,19 +45,19 @@ module Manifesto {
var resource: IResource = firstImage.getResource();
var services: IService[] = resource.getServices();

if (!width){
if (!width) {
width = resource.getWidth();
}

if (services.length){
if (services.length) {
var service: IService = services[0];
id = service.id;
quality = Utils.getImageQuality(service.getProfile());
}
}

// todo: this is not compatible and should be moved to getThumbUri
if (!id){
if (!id) {
return "undefined" == typeof this.__jsonld.thumbnail
? null : this.__jsonld.thumbnail;
}
Expand Down

0 comments on commit 9352a1f

Please sign in to comment.