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

Various improvements to the updated Go library and example app #64

Merged
merged 5 commits into from
Sep 4, 2018

Conversation

leonklingele-work
Copy link
Contributor

@leonklingele-work leonklingele-work commented Aug 20, 2018

  • Register another heif image format header
  • Remove debug code
  • Don't pre- and suffix error variables
  • Better output formatting of example
  • Goify names (remove underscores, uppercase ID, etc.)

Copy link
Member

@fancycode fancycode left a comment

Choose a reason for hiding this comment

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

Thanks, left some comments. I think you also need to rebase to fix this error:
https://travis-ci.org/strukturag/libheif/jobs/418152407

go/heif/heif.go Outdated
@@ -94,12 +94,12 @@ const (
ProgressStepLoadTile = C.heif_progress_step_load_tile
)

// --- HeifError
Copy link
Member

Choose a reason for hiding this comment

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

We want to expose the HeifError so users can cast the returned error to HeifError and inspect the actual error.

go/heif/heif.go Outdated

type ErrorCode int
type errorCode int
Copy link
Member

Choose a reason for hiding this comment

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

Keep exported, see above.

go/heif/heif.go Outdated
)

type ErrorSubcode int
type errorSubcode int
Copy link
Member

Choose a reason for hiding this comment

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

Keep exported, see above.

go/heif/heif.go Outdated
type HeifError struct {
Code ErrorCode
Subcode ErrorSubcode
type heifError struct {
Copy link
Member

Choose a reason for hiding this comment

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

Keep exported, see above.

go/heif/heif.go Outdated
@@ -694,6 +690,7 @@ func decodeConfig(r io.Reader) (image.Config, error) {
}

func init() {
image.RegisterFormat("heif", "\x00\x00\x00\x18\x66\x74\x79\x70", decodeImage, decodeConfig)
Copy link
Member

Choose a reason for hiding this comment

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

Please move below the other RegisterFormat and update the comment.

@leonklingele
Copy link
Contributor

Rebased to master & addressed your comments. PTAL @fancycode

if err.Code == ErrorUnsupportedFiletype {
fmt.Println("XXX")
}
return err
Copy link
Member

Choose a reason for hiding this comment

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

The return err should remain (see Travis errors).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oopsie, fixed.

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

Successfully merging this pull request may close these issues.

None yet

3 participants