Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove frames in PixelDataInfo if the frame channel option is used #295

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions read.go
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,9 @@ func (r *reader) readPixelData(vl uint32, d *Dataset, fc chan<- *frame.Frame) (V

if fc != nil {
fc <- &f
} else {
image.Frames = append(image.Frames, &f)
}
Comment on lines +259 to 261
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose this is also an API change that means the PixelDataInfo returned from Parse will not have frames populated if the framechannel option is used? This might be ok, but is a meaningful change I'll think about a little.


image.Frames = append(image.Frames, &f)
}
image.IntentionallySkipped = r.opts.skipPixelData
return &pixelDataValue{PixelDataInfo: image}, nil
Expand Down Expand Up @@ -482,9 +482,10 @@ func (r *reader) readNativeFrames(parsedData *Dataset, fc chan<- *frame.Frame, v
currentFrame.NativeData.Data[pixel] = buf[pixel*samplesPerPixel : (pixel+1)*samplesPerPixel]
}
}
image.Frames[frameIdx] = &currentFrame
if fc != nil {
fc <- &currentFrame // write the current frame to the frame channel
} else {
image.Frames[frameIdx] = &currentFrame
}
}
if skipFinalPaddingByte {
Expand Down