Skip to content

Commit

Permalink
allow legacy extents for imageblk
Browse files Browse the repository at this point in the history
  • Loading branch information
DocSavage committed Nov 22, 2017
1 parent b348696 commit bdf6efa
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions datatype/imageblk/imageblk.go
Original file line number Diff line number Diff line change
Expand Up @@ -1268,10 +1268,18 @@ func (d *Data) GetExtents(ctx *datastore.VersionedCtx) (dvid.Extents, error) {
return dvidextents, err
}
if extents.MinPoint == nil || extents.MaxPoint == nil {
return dvidextents, nil
// assume this is old dataset and try to use values under Properties.
if d.Properties.MinPoint == nil || d.Properties.MaxPoint == nil {
return dvidextents, nil
}
dvidextents.MinPoint = d.Properties.MinPoint
dvidextents.MaxPoint = d.Properties.MaxPoint
extents.MinPoint = d.Properties.MinPoint
extents.MaxPoint = d.Properties.MaxPoint
} else {
dvidextents.MinPoint = extents.MinPoint
dvidextents.MaxPoint = extents.MaxPoint
}
dvidextents.MinPoint = extents.MinPoint
dvidextents.MaxPoint = extents.MaxPoint

// derive corresponding block coordinate
blockSize, ok := d.BlockSize().(dvid.Point3d)
Expand Down

0 comments on commit bdf6efa

Please sign in to comment.