With some JP2 images, iipserver (version 0.9.9) seems to serve an invalid tile and subsequent tiles are 'moved'. With most of the JP2 images the issue is not present, the only real difference I spotted was a difference in dimensions (width / height)
As the log below shows, the request for the 3rd tile returns a 1 x 256 pixel image which in fact is an invalid JPG. The 4th tile is returned ok, but the contents is what I expected in the 3rd tile! The same for tile 7 which is invalid, the 8th tile returns the contents I expected in tile 6.
normal | actual
0 1 2 | 0 1 2
3 4 5 | x 4(=3 ) 5(=4)
6 7 8 | 6(=5) x 8 (=6)
Strangly enough, this occurs with resolution 2, 3 and 4. With resolution 3 the tiles 6,13,20 and 27 are invalid. With resolution 4 the tiles 12,25,38,51,64,77,90 and 103 are invalid. With resolution 0, 1 and 5 all of the tiles are correct! This issue is reproducable, also after server restart (empty cache).
The logfile below shows that the 3rd and 7th tile (resolution 2) return an 1x256 pixel tile, but shows no errors!
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&obj=IIP,1.0&obj=Max-size&obj=Tile-size&obj=Resolution-number
[1/5]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache initialisation
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 511 microseconds
[2/5]: Command / Argument is obj : IIP,1.0
OBJ :: iip,1.0 to be handled
OBJ :: Total command time 1 microseconds
[3/5]: Command / Argument is obj : Max-size
OBJ :: max-size to be handled
OBJ :: Max-size is 6145 4353
OBJ :: Total command time 14 microseconds
[4/5]: Command / Argument is obj : Tile-size
OBJ :: tile-size to be handled
OBJ :: Tile-size is 256 256
OBJ :: Total command time 7 microseconds
[5/5]: Command / Argument is obj : Resolution-number
OBJ :: resolution-number to be handled
OBJ :: Resolution-number handler returning 6
OBJ :: Total command time 6 microseconds
---
Server: iipsrv/0.9.9
Cache-Control: max-age=86400
Last-Modified: Fri, 25 Jul 2014 14:42:12 GMT
Content-Type: application/vnd.netfpx
IIP:1.0
Max-size:6145 4353
Tile-size:256 256
Resolution-number:6
---
Total Request Time: 873 microseconds
image closed and deleted
Server count is 1
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&WID=228&QLT=95&CVT=jpeg
[1/4]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache hit. Number of elements: 1
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 216 microseconds
[2/4]: Command / Argument is WID : 228
WID handler reached
WID :: requested width is 228
[3/4]: Command / Argument is QLT : 95
[4/4]: Command / Argument is CVT : jpeg
CVT handler reached
CVT :: JPEG output handler reached
CVT :: image set to 385x273 using resolution 1
CVT :: No view port set
CVT :: Requested scaled region size is 227x161. Nearest pyramid region size is 385x273
CVT :: About to JPEG compress image
CVT :: Compressed data strip length is 79057
CVT :: Total command time 51464 microseconds
Total Request Time: 51913 microseconds
image closed and deleted
Server count is 2
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&SDS=0,90&JTL=2,4
[1/3]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache hit. Number of elements: 1
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 233 microseconds
[2/3]: Command / Argument is SDS : 0,90
SDS handler reached
SDS :: set to 0, 90
[3/3]: Command / Argument is JTL : 2,4
JTL handler reached
TileManager :: Cache Miss for resolution: 2, tile: 4
TileManager :: Cache Size: 0 tiles, 0 MB
TileManager :: JPEG Compression Time: 4398 microseconds
TileManager :: Tile cache insertion time: 105 microseconds
TileManager :: Total Tile Access Time: 31149 microseconds
JTL :: Tile size: 256 x 256
JTL :: Channels per sample: 1
JTL :: Bits per channel: 8
JTL :: Compressed tile size is 41684
JTL :: Total command time 31239 microseconds
Total Request Time: 31627 microseconds
image closed and deleted
Server count is 3
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&SDS=0,90&JTL=2,1
[1/3]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache hit. Number of elements: 1
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 217 microseconds
[2/3]: Command / Argument is SDS : 0,90
SDS handler reached
SDS :: set to 0, 90
[3/3]: Command / Argument is JTL : 2,1
JTL handler reached
TileManager :: Cache Miss for resolution: 2, tile: 1
TileManager :: Cache Size: 1 tiles, 0.0410713 MB
TileManager :: JPEG Compression Time: 4101 microseconds
TileManager :: Tile cache insertion time: 30 microseconds
TileManager :: Total Tile Access Time: 32361 microseconds
JTL :: Tile size: 256 x 256
JTL :: Channels per sample: 1
JTL :: Bits per channel: 8
JTL :: Compressed tile size is 37983
JTL :: Total command time 32421 microseconds
Total Request Time: 32793 microseconds
image closed and deleted
Server count is 4
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&SDS=0,90&JTL=2,3
[1/3]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache hit. Number of elements: 1
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 218 microseconds
[2/3]: Command / Argument is SDS : 0,90
SDS handler reached
SDS :: set to 0, 90
[3/3]: Command / Argument is JTL : 2,3
JTL handler reached
TileManager :: Cache Miss for resolution: 2, tile: 3
TileManager :: Cache Size: 2 tiles, 0.0785283 MB
TileManager :: JPEG Compression Time: 78 microseconds
TileManager :: Tile cache insertion time: 9 microseconds
TileManager :: Total Tile Access Time: 17732 microseconds
JTL :: Tile size: 1 x 256
JTL :: Channels per sample: 1
JTL :: Bits per channel: 8
JTL :: Compressed tile size is 196
JTL :: Total command time 17783 microseconds
Total Request Time: 18145 microseconds
image closed and deleted
Server count is 5
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&SDS=0,90&JTL=2,5
[1/3]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache hit. Number of elements: 1
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 216 microseconds
[2/3]: Command / Argument is SDS : 0,90
SDS handler reached
SDS :: set to 0, 90
[3/3]: Command / Argument is JTL : 2,5
JTL handler reached
TileManager :: Cache Miss for resolution: 2, tile: 5
TileManager :: Cache Size: 3 tiles, 0.079084 MB
TileManager :: JPEG Compression Time: 4364 microseconds
TileManager :: Tile cache insertion time: 30 microseconds
TileManager :: Total Tile Access Time: 32517 microseconds
JTL :: Tile size: 256 x 256
JTL :: Channels per sample: 1
JTL :: Bits per channel: 8
JTL :: Compressed tile size is 42596
JTL :: Total command time 32584 microseconds
Total Request Time: 33051 microseconds
image closed and deleted
Server count is 6
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&SDS=0,90&JTL=2,7
[1/3]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache hit. Number of elements: 1
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 246 microseconds
[2/3]: Command / Argument is SDS : 0,90
SDS handler reached
SDS :: set to 0, 90
[3/3]: Command / Argument is JTL : 2,7
JTL handler reached
TileManager :: Cache Miss for resolution: 2, tile: 7
TileManager :: Cache Size: 4 tiles, 0.121046 MB
TileManager :: JPEG Compression Time: 72 microseconds
TileManager :: Tile cache insertion time: 9 microseconds
TileManager :: Total Tile Access Time: 18939 microseconds
JTL :: Tile size: 1 x 256
JTL :: Channels per sample: 1
JTL :: Bits per channel: 8
JTL :: Compressed tile size is 119
JTL :: Total command time 18974 microseconds
Total Request Time: 19376 microseconds
image closed and deleted
Server count is 7
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&SDS=0,90&JTL=2,0
[1/3]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache hit. Number of elements: 1
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 213 microseconds
[2/3]: Command / Argument is SDS : 0,90
SDS handler reached
SDS :: set to 0, 90
[3/3]: Command / Argument is JTL : 2,0
JTL handler reached
TileManager :: Cache Miss for resolution: 2, tile: 0
TileManager :: Cache Size: 5 tiles, 0.121526 MB
TileManager :: JPEG Compression Time: 4244 microseconds
TileManager :: Tile cache insertion time: 32 microseconds
TileManager :: Total Tile Access Time: 28661 microseconds
JTL :: Tile size: 256 x 256
JTL :: Channels per sample: 1
JTL :: Bits per channel: 8
JTL :: Compressed tile size is 38094
JTL :: Total command time 28724 microseconds
Total Request Time: 29094 microseconds
image closed and deleted
Server count is 8
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&SDS=0,90&JTL=2,2
[1/3]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache hit. Number of elements: 1
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 216 microseconds
[2/3]: Command / Argument is SDS : 0,90
SDS handler reached
SDS :: set to 0, 90
[3/3]: Command / Argument is JTL : 2,2
JTL handler reached
TileManager :: Cache Miss for resolution: 2, tile: 2
TileManager :: Cache Size: 6 tiles, 0.159092 MB
TileManager :: JPEG Compression Time: 4073 microseconds
TileManager :: Tile cache insertion time: 114 microseconds
TileManager :: Total Tile Access Time: 27753 microseconds
JTL :: Tile size: 256 x 256
JTL :: Channels per sample: 1
JTL :: Bits per channel: 8
JTL :: Compressed tile size is 37832
JTL :: Total command time 27814 microseconds
Total Request Time: 28163 microseconds
image closed and deleted
Server count is 9
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&SDS=0,90&JTL=2,6
[1/3]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache hit. Number of elements: 1
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 222 microseconds
[2/3]: Command / Argument is SDS : 0,90
SDS handler reached
SDS :: set to 0, 90
[3/3]: Command / Argument is JTL : 2,6
JTL handler reached
TileManager :: Cache Miss for resolution: 2, tile: 6
TileManager :: Cache Size: 7 tiles, 0.196401 MB
TileManager :: JPEG Compression Time: 4318 microseconds
TileManager :: Tile cache insertion time: 31 microseconds
TileManager :: Total Tile Access Time: 29684 microseconds
JTL :: Tile size: 256 x 256
JTL :: Channels per sample: 1
JTL :: Bits per channel: 8
JTL :: Compressed tile size is 41241
JTL :: Total command time 29753 microseconds
Total Request Time: 30214 microseconds
image closed and deleted
Server count is 10
CVT maximum viewport size set to 6400
Full Request is FIF=sc/1869-1917/1903-005/1903-005_00021.jp2&SDS=0,90&JTL=2,8
[1/3]: Command / Argument is FIF : sc/1869-1917/1903-005/1903-005_00021.jp2
FIF handler reached
FIF :: URL decoding/filtering: sc/1869-1917/1903-005/1903-005_00021.jp2 => sc/1869-1917/1903-005/1903-005_00021.jp2
FIF :: Image cache hit. Number of elements: 1
FIF :: JPEG2000 image requested
FIF :: Created image
FIF :: Image dimensions are 6145 x 4353
FIF :: Image timestamp: Fri, 25 Jul 2014 14:42:12 GMT
FIF :: Total command time 257 microseconds
[2/3]: Command / Argument is SDS : 0,90
SDS handler reached
SDS :: set to 0, 90
[3/3]: Command / Argument is JTL : 2,8
JTL handler reached
TileManager :: Cache Miss for resolution: 2, tile: 8
TileManager :: Cache Size: 8 tiles, 0.23704 MB
TileManager :: JPEG Compression Time: 408 microseconds
TileManager :: Tile cache insertion time: 10 microseconds
TileManager :: Total Tile Access Time: 4554 microseconds
JTL :: Tile size: 256 x 33
JTL :: Channels per sample: 1
JTL :: Bits per channel: 8
JTL :: Compressed tile size is 2849
JTL :: Total command time 4592 microseconds
Total Request Time: 5022 microseconds
image closed and deleted
Server count is 11