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

proposal: image/gif: support writing comment extensions #67062

Closed
abergmeier opened this issue Apr 26, 2024 · 7 comments
Closed

proposal: image/gif: support writing comment extensions #67062

abergmeier opened this issue Apr 26, 2024 · 7 comments
Labels
Milestone

Comments

@abergmeier
Copy link

abergmeier commented Apr 26, 2024

Proposal Details

When reading, currently Golang ignores Comment Extensions.
I have a fork of image/gif in https://github.com/abergmeier/gitwriter https://github.com/abergmeier/gifwriter which allows for writing Comment Extensions.

If there would be some guidance I could try to integrate that into standard library.

@gopherbot gopherbot added this to the Proposal milestone Apr 26, 2024
@ianlancetaylor
Copy link
Contributor

CC @nigeltao

@jfrech
Copy link

jfrech commented Apr 26, 2024

Did you mean to link to https://github.com/abergmeier/gifwriter?

@abergmeier
Copy link
Author

Did you mean to link to https://github.com/abergmeier/gifwriter?

Indeed. Yeah sorry for that mistake.

@seankhliao seankhliao changed the title proposal: image/gif: Support writing Comment Extensions proposal: image/gif: support writing comment extensions Apr 27, 2024
@jfrech
Copy link

jfrech commented Apr 28, 2024

If you want to follow through with your proposal, I would advise you to a) rebase your fork so the top commit represents your diff to the standard library and b) write some documentation comments and integration tests decoding an entire image file.

@seankhliao
Copy link
Member

It'd be more important to reference the appropriate specs and demonstrate why this is an important addition to the standard library.

@nigeltao
Copy link
Contributor

The OP mentions both reading and writing GIF comments. It's not clear whether you are proposing to add reading, writing or both to image/gif.

For reading, the PNG image file format also allows for comments but image/png does not surface them, and we haven't had many (or any??) complaints about that. It's not clear that there's enough demand for being able to read GIF comments. And even if there was, go get github.com/you/yourgiflibrary is easy and idiomatic. It's not like people can't do this at all. They just can't do it with the standard library.

For writing, similarly, I don't see evidence of overwhelming demand for this feature. But also, you may be able to do this without stdlib changes: https://nigeltao.github.io/blog/2021/from-jpeg-to-jfif.html

Also, as I recently said on #67050 (comment)

anything in the standard library has to be supported forever and, once released, its API is frozen forever. There's a high bar for adding anything to the stdlib at this point.

@abergmeier
Copy link
Author

@nigeltao Fair enough. For future transparency though, IMO it would be good to state the limitation/scope of the current stdlib implementation explicitly in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

6 participants