id,summary,reporter,owner,description,type,status,priority,milestone,component,version,severity,resolution,keywords,cc 5585,JP2KAK format: Generating TLM causes an error due to bad fseek call,plroit,warmerdam,"Hi, There is a bug in GDAL_ROOT\frmts\jp2kak\vsil_target.h in method vsil_target::end_rewrite You can see that the parameters to the VSIFSeekL method call are swapped in place. (Compare to the same method call in vsil_target::start_rewrite). What it should be: VSIFSeekL( file, 0, SEEK_END) != 0 What it is as of today: VSIFSeekL( file, SEEK_END, 0) != 0 The error can be recreated by using multiple tiles with ORGgen_tlm=X option, where X is the estimated (upper bound) number of tile-parts per tile. This effectively prevents the caller from generating jp2 files with TLM index. The TLM index is generated by Kakadu library after all of the tile-parts are flushed to the target file. Kakadu library then seeks back to a pre-configured location to write the TLM segment by calling start_rewrite. To return the file position to the previous location, kakadu calls end_rewrite and proceeds in operation. ",defect,closed,normal,1.11.1,GDAL_Raster,1.11.0,blocker,fixed,jp2kak TLM fseek,