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

MIME type #1528

Closed
RustyNixieTube opened this issue Aug 6, 2021 · 2 comments · Fixed by #1538
Closed

MIME type #1528

RustyNixieTube opened this issue Aug 6, 2021 · 2 comments · Fixed by #1538

Comments

@RustyNixieTube
Copy link
Contributor

RustyNixieTube commented Aug 6, 2021

I would like to be able to create ImageFormat from a MIME type.

My specific use case for this functionality is decoding an image that comes from a js function.

if this feature is accepted, i will do a pr for it.

Draft

impl ImageFormat {
    fn from_mime_type(mime_type: &str) -> Option<Self> {
        match mime_type {
             "image/png" => Some(ImageFormat::Png)
             _ => todo!();
        }
    }
}
@fintelia
Copy link
Contributor

fintelia commented Aug 8, 2021

This sounds good to me.

@RustyNixieTube
Copy link
Contributor Author

RustyNixieTube commented Aug 14, 2021

ok i will open a pr for it.

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 a pull request may close this issue.

2 participants