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

raw encoding should return the buff #22

Open
yannliao opened this issue Jan 11, 2021 · 0 comments
Open

raw encoding should return the buff #22

yannliao opened this issue Jan 11, 2021 · 0 comments

Comments

@yannliao
Copy link

in raw encoding func (*RawEncoding) Read(...) always return nil buff.

for y := uint16(0); y < rect.Height; y++ {
  for x := uint16(0); x < rect.Width; x++ {
	  if bts, err := r.ReadBytes(bytesPerPixel); err != nil {
		  StoreBytes(bytes, bts)
		  return nil, err
	  }
  }
}

StoreBytes(bytes, bts) should called outside the error assertion :

for y := uint16(0); y < rect.Height; y++ {
  for x := uint16(0); x < rect.Width; x++ {
	  bts, err := r.ReadBytes(bytesPerPixel)
	  if err != nil {
		  return nil, err
	  }
	  StoreBytes(bytes, bts)
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant