Skip to content

Commit

Permalink
Merge pull request #122 from PonteIneptique/patch-1
Browse files Browse the repository at this point in the history
Check that property were retrieved at OnFragment
  • Loading branch information
stephenwf authored Feb 1, 2023
2 parents 40ee45f + 0afafd0 commit baff1a1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/Canvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,7 @@ export class Canvas extends Resource {
const on = resourceAnnotation.getProperty("on");
// IIIF v3
const target = resourceAnnotation.getProperty("target");
if (!on || !target) { return undefined; }
const fragmentMatch = (on || target).match(/xywh=(.*)$/);
if (!fragmentMatch) return undefined;
return fragmentMatch[1].split(",").map(str => parseInt(str, 10));
Expand Down

0 comments on commit baff1a1

Please sign in to comment.