Skip to content

Made Tag::from_u16, from_u16_exhaustive and to_u16 const#241

Closed
dbartussek wants to merge 1 commit intoimage-rs:mainfrom
dbartussek:tag_const
Closed

Made Tag::from_u16, from_u16_exhaustive and to_u16 const#241
dbartussek wants to merge 1 commit intoimage-rs:mainfrom
dbartussek:tag_const

Conversation

@dbartussek
Copy link
Copy Markdown
Contributor

I'm using image-tiff to write DNG files, using a lot of currently Unknown tags as a result.
For forward compatibility once some of these tags are defined (#47, #210), I'm using Tag::from_u16_exhaustive.

This patch changes the u16 conversion functions to be const functions so Tag constants can be defined from raw numeric ids without having to always define them as Unknown.

@197g 197g mentioned this pull request Jan 5, 2026
@197g 197g closed this in #318 Jan 5, 2026
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.

1 participant