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/iiif_1_0_files/0,0,1024,1024/pct:25/0/native.jpg b/test/data/iiif_1_0_files/0,0,1024,1024/pct:25/0/native.jpg deleted file mode 100644 index cdaeeb98..00000000 Binary files a/test/data/iiif_1_0_files/0,0,1024,1024/pct:25/0/native.jpg and /dev/null differ diff --git a/test/data/iiif_1_0_files/0,0,2048,2048/pct:12.5/0/native.jpg b/test/data/iiif_1_0_files/0,0,2048,2048/pct:12.5/0/native.jpg deleted file mode 100644 index b30c22fb..00000000 Binary files a/test/data/iiif_1_0_files/0,0,2048,2048/pct:12.5/0/native.jpg and /dev/null differ diff --git a/test/data/iiif_1_0_files/0,0,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/0,0,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/0,0,512,512/256,/0/b0.jpg b/test/data/iiif_1_0_files/0,0,512,512/256,/0/b0.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/b0.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,512,512/pct:50/0/native.jpg b/test/data/iiif_1_0_files/0,0,512,512/pct:50/0/native.jpg deleted file mode 100644 index c0ede910..00000000 Binary files a/test/data/iiif_1_0_files/0,0,512,512/pct:50/0/native.jpg and /dev/null differ diff --git a/test/data/iiif_1_0_files/0,0,775,1024/194,/0/b0.jpg b/test/data/iiif_1_0_files/0,0,775,1024/194,/0/b0.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/b0.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,0,775,1024/pct:25/0/native.jpg b/test/data/iiif_1_0_files/0,0,775,1024/pct:25/0/native.jpg deleted file mode 100644 index cdaeeb98..00000000 Binary files a/test/data/iiif_1_0_files/0,0,775,1024/pct:25/0/native.jpg and /dev/null differ diff --git a/test/data/iiif_1_0_files/0,256,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/0,256,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/0,512,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/0,512,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/0,512,512,512/256,/0/b0.jpg b/test/data/iiif_1_0_files/0,512,512,512/256,/0/b0.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/b0.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,512,512,512/pct:50/0/native.jpg b/test/data/iiif_1_0_files/0,512,512,512/pct:50/0/native.jpg deleted file mode 100644 index 59ec177b..00000000 Binary files a/test/data/iiif_1_0_files/0,512,512,512/pct:50/0/native.jpg and /dev/null differ diff --git a/test/data/iiif_1_0_files/0,768,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/0,768,256,256/256,/0/b0.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/b0.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/b0.jpg b/test/data/iiif_1_0_files/256,0,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/256,256,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/256,256,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/256,512,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/256,512,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/256,768,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/256,768,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/512,0,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/512,0,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/512,0,263,512/132,/0/b0.jpg b/test/data/iiif_1_0_files/512,0,263,512/132,/0/b0.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/b0.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,0,263,512/pct:50/0/native.jpg b/test/data/iiif_1_0_files/512,0,263,512/pct:50/0/native.jpg deleted file mode 100644 index 2426215c..00000000 Binary files a/test/data/iiif_1_0_files/512,0,263,512/pct:50/0/native.jpg and /dev/null differ diff --git a/test/data/iiif_1_0_files/512,256,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/512,256,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/512,512,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/512,512,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/512,512,263,512/132,/0/b0.jpg b/test/data/iiif_1_0_files/512,512,263,512/132,/0/b0.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/b0.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,512,263,512/pct:50/0/native.jpg b/test/data/iiif_1_0_files/512,512,263,512/pct:50/0/native.jpg deleted file mode 100644 index f3113543..00000000 Binary files a/test/data/iiif_1_0_files/512,512,263,512/pct:50/0/native.jpg and /dev/null differ diff --git a/test/data/iiif_1_0_files/512,768,256,256/256,/0/b0.jpg b/test/data/iiif_1_0_files/512,768,256,256/256,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/768,0,7,256/7,/0/b0.jpg b/test/data/iiif_1_0_files/768,0,7,256/7,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/768,256,7,256/7,/0/b0.jpg b/test/data/iiif_1_0_files/768,256,7,256/7,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/768,512,7,256/7,/0/b0.jpg b/test/data/iiif_1_0_files/768,512,7,256/7,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/768,768,7,256/7,/0/b0.jpg b/test/data/iiif_1_0_files/768,768,7,256/7,/0/b0.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/b0.jpg differ diff --git a/test/data/iiif_1_0_files/full/1,/0/b0.jpg b/test/data/iiif_1_0_files/full/1,/0/b0.jpg new file mode 100644 index 00000000..6b3670c8 Binary files /dev/null and b/test/data/iiif_1_0_files/full/1,/0/b0.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/b0.jpg b/test/data/iiif_1_0_files/full/13,/0/b0.jpg new file mode 100644 index 00000000..f9cb6979 Binary files /dev/null and b/test/data/iiif_1_0_files/full/13,/0/b0.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/b0.jpg b/test/data/iiif_1_0_files/full/2,/0/b0.jpg new file mode 100644 index 00000000..a335cd34 Binary files /dev/null and b/test/data/iiif_1_0_files/full/2,/0/b0.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/b0.jpg b/test/data/iiif_1_0_files/full/25,/0/b0.jpg new file mode 100644 index 00000000..18a43a03 Binary files /dev/null and b/test/data/iiif_1_0_files/full/25,/0/b0.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/b0.jpg b/test/data/iiif_1_0_files/full/4,/0/b0.jpg new file mode 100644 index 00000000..ce882561 Binary files /dev/null and b/test/data/iiif_1_0_files/full/4,/0/b0.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/b0.jpg b/test/data/iiif_1_0_files/full/49,/0/b0.jpg new file mode 100644 index 00000000..68b8eb9c Binary files /dev/null and b/test/data/iiif_1_0_files/full/49,/0/b0.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/b0.jpg b/test/data/iiif_1_0_files/full/7,/0/b0.jpg new file mode 100644 index 00000000..4c234847 Binary files /dev/null and b/test/data/iiif_1_0_files/full/7,/0/b0.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/b0.jpg b/test/data/iiif_1_0_files/full/97,/0/b0.jpg new file mode 100644 index 00000000..4afad0bf Binary files /dev/null and b/test/data/iiif_1_0_files/full/97,/0/b0.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_0_files/full/pct:1.5625/0/native.jpg b/test/data/iiif_1_0_files/full/pct:1.5625/0/native.jpg deleted file mode 100644 index a5cfdec0..00000000 Binary files a/test/data/iiif_1_0_files/full/pct:1.5625/0/native.jpg and /dev/null differ diff --git a/test/data/iiif_1_0_files/full/pct:12.5/0/native.jpg b/test/data/iiif_1_0_files/full/pct:12.5/0/native.jpg deleted file mode 100644 index b30c22fb..00000000 Binary files a/test/data/iiif_1_0_files/full/pct:12.5/0/native.jpg and /dev/null differ diff --git a/test/data/iiif_1_0_files/full/pct:3.125/0/native.jpg b/test/data/iiif_1_0_files/full/pct:3.125/0/native.jpg deleted file mode 100644 index 09817ed6..00000000 Binary files a/test/data/iiif_1_0_files/full/pct:3.125/0/native.jpg and /dev/null differ diff --git a/test/data/iiif_1_0_files/full/pct:6.25/0/native.jpg b/test/data/iiif_1_0_files/full/pct:6.25/0/native.jpg deleted file mode 100644 index c7467382..00000000 Binary files a/test/data/iiif_1_0_files/full/pct:6.25/0/native.jpg and /dev/null differ