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

Create Image::to_base64 #91

Merged
merged 3 commits into from
Dec 9, 2024
Merged

Conversation

boswelja
Copy link
Contributor

@boswelja boswelja commented Dec 1, 2024

This opens up the possibility of models sending back images, and clients being able to get the image contents as base64.
I've also updated from_base64 to take an impl Into<String>, meaning the function will be happy to take an &str or a String, and run cargo clippy --fix

@boswelja
Copy link
Contributor Author

boswelja commented Dec 1, 2024

I wasn't sure what the preferred behavior is here 0 as the PR is now it'll give you a borrowed reference to the images base64 representation, but I can see value in having to_base64() consume the Image and give a String, ex

    pub fn to_base64(self) -> String {
        self.0
    }
    ```

@pepperoni21 pepperoni21 merged commit ecc1927 into pepperoni21:master Dec 9, 2024
2 checks passed
@boswelja boswelja deleted the image-to-b64 branch December 14, 2024 01:42
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.

2 participants