diff --git a/changelog.txt b/changelog.txt
index 8047a28a..377a7c35 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -19,6 +19,7 @@ OPENSEADRAGON CHANGELOG
* MouseTracker now passes the original event objects to its handler methods (#23)
* MouseTracker now supports an optional 'moveHandler' method for tracking mousemove events (#215)
* Fixed: Element-relative mouse coordinates now correct if the element and/or page is scrolled (using new OpenSeadragon.getElementOffset() method) (#131)
+* Added IIIF Image API 1.1 Tile Source (#230)
* Fixed: Touch event issue where no canvas-click events were being raised (#240)
0.9.131:
diff --git a/src/iiiftilesource.js b/src/iiiftilesource.js
index 908fc38d..99a07798 100644
--- a/src/iiiftilesource.js
+++ b/src/iiiftilesource.js
@@ -169,7 +169,7 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, {
scale = Math.pow( 0.5, this.maxLevel - level ),
//## get iiif size
- iiif_size = 'pct:' + ( scale * 100 ),
+ // iiif_size = 'pct:' + ( scale * 100 ),
//# image dimensions at this level
level_width = Math.ceil( this.width * scale ),
@@ -182,16 +182,19 @@ $.extend( $.IIIFTileSource.prototype, $.TileSource.prototype, {
iiif_tile_x,
iiif_tile_y,
iiif_tile_w,
- iiif_tile_h;
+ iiif_tile_h,
+ iiif_size;
if ( level_width < this.tile_width && level_height < this.tile_height ){
+ iiif_size = level_width + ","; // + level_height; only one dim. for IIIF level 1 compliance
iiif_region = 'full';
} else {
iiif_tile_x = x * iiif_tile_size_width;
iiif_tile_y = y * iiif_tile_size_height;
iiif_tile_w = Math.min( iiif_tile_size_width, this.width - iiif_tile_x );
iiif_tile_h = Math.min( iiif_tile_size_height, this.height - iiif_tile_y );
+ iiif_size = Math.ceil(iiif_tile_w * scale) + ",";
iiif_region = [ iiif_tile_x, iiif_tile_y, iiif_tile_w, iiif_tile_h ].join(',');
}
diff --git a/test/data/iiif1_0.json b/test/data/iiif1_0.json
index 2c55544c..73b91061 100644
--- a/test/data/iiif1_0.json
+++ b/test/data/iiif1_0.json
@@ -1,13 +1,14 @@
{
- "identifier": "pudl0001/4609321/s42/00000001",
- "width": 2584,
- "height": 3600,
+ "identifier": "iiif_1_0_files",
+ "width": 775,
+ "height": 1024,
"scale_factors": [
1,
2,
3,
4,
- 5
+ 5,
+ 6
],
"tile_width": 256,
"tile_height": 256,
@@ -21,6 +22,5 @@
"grey",
"color"
],
- "profile": "http://library.stanford.edu/iiif/image-api/compliance.html#level1",
- "image_host": "http://lorisimg.princeton.edu/loris"
+ "profile": "http://library.stanford.edu/iiif/image-api/compliance.html#level1"
}
diff --git a/test/data/iiif1_0.xml b/test/data/iiif1_0.xml
index 3e7f931f..6dab2b4f 100644
--- a/test/data/iiif1_0.xml
+++ b/test/data/iiif1_0.xml
@@ -1 +1,26 @@
-pudl0001/4609321/s42/000000012584360012345256256jpgpngnativebitonalgreycolorhttp://library.stanford.edu/iiif/image-api/compliance.html#level1http://lorisimg.princeton.edu/loris
+
+ iiif_1_0_files
+ 775
+ 1024
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ 6
+
+ 256
+ 256
+
+ jpg
+ png
+
+
+ native
+ bitonal
+ grey
+ color
+
+ http://library.stanford.edu/iiif/image-api/compliance.html#level1
+
diff --git a/test/data/iiif1_1.json b/test/data/iiif1_1.json
index 5a33ce73..1ad7a6fa 100644
--- a/test/data/iiif1_1.json
+++ b/test/data/iiif1_1.json
@@ -5,11 +5,12 @@
2,
4,
8,
- 16
+ 16,
+ 32
],
"tile_height": 256,
- "height": 3600,
- "width": 2584,
+ "height": 1024,
+ "width": 775,
"tile_width": 256,
"qualities": [
"native",
@@ -23,5 +24,5 @@
"gif"
],
"@context": "http://library.stanford.edu/iiif/image-api/1.1/context.json",
- "@id": "http://libimages.princeton.edu/loris/pudl0071%2F4055459%2F01%2F00000030.jp2"
-}
\ No newline at end of file
+ "@id": "http://localhost:8000/test/data/iiif_1_1_files"
+}
diff --git a/test/data/iiif_1_0_files/0,0,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/0,0,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..a29c5568
Binary files /dev/null and b/test/data/iiif_1_0_files/0,0,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/0,0,512,512/256,/0/native.jpg b/test/data/iiif_1_0_files/0,0,512,512/256,/0/native.jpg
new file mode 100644
index 00000000..edb856cc
Binary files /dev/null and b/test/data/iiif_1_0_files/0,0,512,512/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/0,0,775,1024/194,/0/native.jpg b/test/data/iiif_1_0_files/0,0,775,1024/194,/0/native.jpg
new file mode 100644
index 00000000..be76af06
Binary files /dev/null and b/test/data/iiif_1_0_files/0,0,775,1024/194,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/0,256,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/0,256,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..cb38ba74
Binary files /dev/null and b/test/data/iiif_1_0_files/0,256,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/0,512,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/0,512,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..0b44da15
Binary files /dev/null and b/test/data/iiif_1_0_files/0,512,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/0,512,512,512/256,/0/native.jpg b/test/data/iiif_1_0_files/0,512,512,512/256,/0/native.jpg
new file mode 100644
index 00000000..250e76d1
Binary files /dev/null and b/test/data/iiif_1_0_files/0,512,512,512/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/0,768,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/0,768,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..8cf078fa
Binary files /dev/null and b/test/data/iiif_1_0_files/0,768,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/256,0,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/256,0,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..36ecb717
Binary files /dev/null and b/test/data/iiif_1_0_files/256,0,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/256,256,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/256,256,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..b57469a8
Binary files /dev/null and b/test/data/iiif_1_0_files/256,256,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/256,512,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/256,512,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..7fd76a78
Binary files /dev/null and b/test/data/iiif_1_0_files/256,512,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/256,768,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/256,768,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..cf96a405
Binary files /dev/null and b/test/data/iiif_1_0_files/256,768,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/512,0,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/512,0,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..ca605428
Binary files /dev/null and b/test/data/iiif_1_0_files/512,0,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/512,0,263,512/132,/0/native.jpg b/test/data/iiif_1_0_files/512,0,263,512/132,/0/native.jpg
new file mode 100644
index 00000000..ca48f792
Binary files /dev/null and b/test/data/iiif_1_0_files/512,0,263,512/132,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/512,256,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/512,256,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..41dd14bb
Binary files /dev/null and b/test/data/iiif_1_0_files/512,256,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/512,512,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/512,512,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..1b42d53c
Binary files /dev/null and b/test/data/iiif_1_0_files/512,512,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/512,512,263,512/132,/0/native.jpg b/test/data/iiif_1_0_files/512,512,263,512/132,/0/native.jpg
new file mode 100644
index 00000000..baa4ee5d
Binary files /dev/null and b/test/data/iiif_1_0_files/512,512,263,512/132,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/512,768,256,256/256,/0/native.jpg b/test/data/iiif_1_0_files/512,768,256,256/256,/0/native.jpg
new file mode 100644
index 00000000..b3e0f5cb
Binary files /dev/null and b/test/data/iiif_1_0_files/512,768,256,256/256,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/768,0,7,256/7,/0/native.jpg b/test/data/iiif_1_0_files/768,0,7,256/7,/0/native.jpg
new file mode 100644
index 00000000..7f08427a
Binary files /dev/null and b/test/data/iiif_1_0_files/768,0,7,256/7,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/768,256,7,256/7,/0/native.jpg b/test/data/iiif_1_0_files/768,256,7,256/7,/0/native.jpg
new file mode 100644
index 00000000..b21f307b
Binary files /dev/null and b/test/data/iiif_1_0_files/768,256,7,256/7,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/768,512,7,256/7,/0/native.jpg b/test/data/iiif_1_0_files/768,512,7,256/7,/0/native.jpg
new file mode 100644
index 00000000..4a92be8c
Binary files /dev/null and b/test/data/iiif_1_0_files/768,512,7,256/7,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/768,768,7,256/7,/0/native.jpg b/test/data/iiif_1_0_files/768,768,7,256/7,/0/native.jpg
new file mode 100644
index 00000000..f167fa29
Binary files /dev/null and b/test/data/iiif_1_0_files/768,768,7,256/7,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/full/1,/0/native.jpg b/test/data/iiif_1_0_files/full/1,/0/native.jpg
new file mode 100644
index 00000000..6b3670c8
Binary files /dev/null and b/test/data/iiif_1_0_files/full/1,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/full/13,/0/native.jpg b/test/data/iiif_1_0_files/full/13,/0/native.jpg
new file mode 100644
index 00000000..f9cb6979
Binary files /dev/null and b/test/data/iiif_1_0_files/full/13,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/full/2,/0/native.jpg b/test/data/iiif_1_0_files/full/2,/0/native.jpg
new file mode 100644
index 00000000..a335cd34
Binary files /dev/null and b/test/data/iiif_1_0_files/full/2,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/full/25,/0/native.jpg b/test/data/iiif_1_0_files/full/25,/0/native.jpg
new file mode 100644
index 00000000..18a43a03
Binary files /dev/null and b/test/data/iiif_1_0_files/full/25,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/full/4,/0/native.jpg b/test/data/iiif_1_0_files/full/4,/0/native.jpg
new file mode 100644
index 00000000..ce882561
Binary files /dev/null and b/test/data/iiif_1_0_files/full/4,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/full/49,/0/native.jpg b/test/data/iiif_1_0_files/full/49,/0/native.jpg
new file mode 100644
index 00000000..68b8eb9c
Binary files /dev/null and b/test/data/iiif_1_0_files/full/49,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/full/7,/0/native.jpg b/test/data/iiif_1_0_files/full/7,/0/native.jpg
new file mode 100644
index 00000000..4c234847
Binary files /dev/null and b/test/data/iiif_1_0_files/full/7,/0/native.jpg differ
diff --git a/test/data/iiif_1_0_files/full/97,/0/native.jpg b/test/data/iiif_1_0_files/full/97,/0/native.jpg
new file mode 100644
index 00000000..4afad0bf
Binary files /dev/null and b/test/data/iiif_1_0_files/full/97,/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/0,0,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/0,0,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..a29c5568
Binary files /dev/null and b/test/data/iiif_1_1_files/0,0,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/0,0,512,512/256,256/0/native.jpg b/test/data/iiif_1_1_files/0,0,512,512/256,256/0/native.jpg
new file mode 100644
index 00000000..edb856cc
Binary files /dev/null and b/test/data/iiif_1_1_files/0,0,512,512/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/0,0,775,1024/194,256/0/native.jpg b/test/data/iiif_1_1_files/0,0,775,1024/194,256/0/native.jpg
new file mode 100644
index 00000000..be76af06
Binary files /dev/null and b/test/data/iiif_1_1_files/0,0,775,1024/194,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/0,256,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/0,256,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..cb38ba74
Binary files /dev/null and b/test/data/iiif_1_1_files/0,256,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/0,512,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/0,512,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..0b44da15
Binary files /dev/null and b/test/data/iiif_1_1_files/0,512,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/0,512,512,512/256,256/0/native.jpg b/test/data/iiif_1_1_files/0,512,512,512/256,256/0/native.jpg
new file mode 100644
index 00000000..250e76d1
Binary files /dev/null and b/test/data/iiif_1_1_files/0,512,512,512/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/0,768,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/0,768,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..8cf078fa
Binary files /dev/null and b/test/data/iiif_1_1_files/0,768,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/256,0,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/256,0,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..36ecb717
Binary files /dev/null and b/test/data/iiif_1_1_files/256,0,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/256,256,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/256,256,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..b57469a8
Binary files /dev/null and b/test/data/iiif_1_1_files/256,256,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/256,512,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/256,512,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..7fd76a78
Binary files /dev/null and b/test/data/iiif_1_1_files/256,512,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/256,768,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/256,768,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..cf96a405
Binary files /dev/null and b/test/data/iiif_1_1_files/256,768,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/512,0,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/512,0,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..ca605428
Binary files /dev/null and b/test/data/iiif_1_1_files/512,0,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/512,0,263,512/132,256/0/native.jpg b/test/data/iiif_1_1_files/512,0,263,512/132,256/0/native.jpg
new file mode 100644
index 00000000..ca48f792
Binary files /dev/null and b/test/data/iiif_1_1_files/512,0,263,512/132,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/512,256,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/512,256,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..41dd14bb
Binary files /dev/null and b/test/data/iiif_1_1_files/512,256,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/512,512,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/512,512,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..1b42d53c
Binary files /dev/null and b/test/data/iiif_1_1_files/512,512,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/512,512,263,512/132,256/0/native.jpg b/test/data/iiif_1_1_files/512,512,263,512/132,256/0/native.jpg
new file mode 100644
index 00000000..baa4ee5d
Binary files /dev/null and b/test/data/iiif_1_1_files/512,512,263,512/132,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/512,768,256,256/256,256/0/native.jpg b/test/data/iiif_1_1_files/512,768,256,256/256,256/0/native.jpg
new file mode 100644
index 00000000..b3e0f5cb
Binary files /dev/null and b/test/data/iiif_1_1_files/512,768,256,256/256,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/768,0,7,256/7,256/0/native.jpg b/test/data/iiif_1_1_files/768,0,7,256/7,256/0/native.jpg
new file mode 100644
index 00000000..7f08427a
Binary files /dev/null and b/test/data/iiif_1_1_files/768,0,7,256/7,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/768,256,7,256/7,256/0/native.jpg b/test/data/iiif_1_1_files/768,256,7,256/7,256/0/native.jpg
new file mode 100644
index 00000000..b21f307b
Binary files /dev/null and b/test/data/iiif_1_1_files/768,256,7,256/7,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/768,512,7,256/7,256/0/native.jpg b/test/data/iiif_1_1_files/768,512,7,256/7,256/0/native.jpg
new file mode 100644
index 00000000..4a92be8c
Binary files /dev/null and b/test/data/iiif_1_1_files/768,512,7,256/7,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/768,768,7,256/7,256/0/native.jpg b/test/data/iiif_1_1_files/768,768,7,256/7,256/0/native.jpg
new file mode 100644
index 00000000..f167fa29
Binary files /dev/null and b/test/data/iiif_1_1_files/768,768,7,256/7,256/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/full/1,1/0/native.jpg b/test/data/iiif_1_1_files/full/1,1/0/native.jpg
new file mode 100644
index 00000000..6b3670c8
Binary files /dev/null and b/test/data/iiif_1_1_files/full/1,1/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/full/13,16/0/native.jpg b/test/data/iiif_1_1_files/full/13,16/0/native.jpg
new file mode 100644
index 00000000..f9cb6979
Binary files /dev/null and b/test/data/iiif_1_1_files/full/13,16/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/full/2,2/0/native.jpg b/test/data/iiif_1_1_files/full/2,2/0/native.jpg
new file mode 100644
index 00000000..a335cd34
Binary files /dev/null and b/test/data/iiif_1_1_files/full/2,2/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/full/25,32/0/native.jpg b/test/data/iiif_1_1_files/full/25,32/0/native.jpg
new file mode 100644
index 00000000..18a43a03
Binary files /dev/null and b/test/data/iiif_1_1_files/full/25,32/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/full/4,4/0/native.jpg b/test/data/iiif_1_1_files/full/4,4/0/native.jpg
new file mode 100644
index 00000000..ce882561
Binary files /dev/null and b/test/data/iiif_1_1_files/full/4,4/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/full/49,64/0/native.jpg b/test/data/iiif_1_1_files/full/49,64/0/native.jpg
new file mode 100644
index 00000000..68b8eb9c
Binary files /dev/null and b/test/data/iiif_1_1_files/full/49,64/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/full/7,8/0/native.jpg b/test/data/iiif_1_1_files/full/7,8/0/native.jpg
new file mode 100644
index 00000000..4c234847
Binary files /dev/null and b/test/data/iiif_1_1_files/full/7,8/0/native.jpg differ
diff --git a/test/data/iiif_1_1_files/full/97,128/0/native.jpg b/test/data/iiif_1_1_files/full/97,128/0/native.jpg
new file mode 100644
index 00000000..4afad0bf
Binary files /dev/null and b/test/data/iiif_1_1_files/full/97,128/0/native.jpg differ