apply default base logic to BSI v1 migration code

This commit is contained in:
Travis Turner 2019-07-31 11:38:36 -05:00
parent c5140ba88d
commit 9e9103d98f
No known key found for this signature in database
GPG key ID: 7F08008DFD9314C9

View file

@ -508,7 +508,13 @@ func (f *Field) loadMeta() error {
// Initialize "base" to "min" when upgrading from v1 BSI format.
if pb.BitDepth == 0 {
pb.Base = pb.Min
if pb.Min > 0 {
pb.Base = pb.Min
} else if pb.Max < 0 {
pb.Base = pb.Max
} else {
pb.Base = 0
}
pb.BitDepth = uint64(bitDepthInt64(pb.Max - pb.Min))
if pb.BitDepth == 0 {
pb.BitDepth = 1