Skip to content

Commit

Permalink
rearrange a conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
suyashkumar committed Jun 1, 2024
1 parent 4d7e5b1 commit 005ec03
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,8 @@ func NewParser(in io.Reader, bytesToRead int64, frameChannel chan *frame.Frame,
implicit := true

ts, err := p.dataset.FindElementByTag(tag.TransferSyntaxUID)
if err != nil {
debug.Log("WARN: could not find transfer syntax uid in metadata, proceeding with little endian implicit")
} else {
if err == nil {
// If we found the transfer syntax, apply it.
tsStr := MustGetStrings(ts.Value)[0]
bo, implicit, err = uid.ParseTransferSyntaxUID(tsStr)
if err != nil {
Expand All @@ -171,6 +170,10 @@ func NewParser(in io.Reader, bytesToRead int64, frameChannel chan *frame.Frame,
if tsStr == uid.DeflatedExplicitVRLittleEndian {
p.reader.rawReader.SetDeflate()
}
} else {
// No transfer syntax found, warn the user we're proceeding with the
// default Little Endian implicit.
debug.Log("WARN: could not find transfer syntax uid in metadata, proceeding with little endian implicit")
}
p.SetTransferSyntax(bo, implicit)

Expand Down

0 comments on commit 005ec03

Please sign in to comment.