Skip to content

Fix mask parameter for ImageEdit request #132

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

glyuck
Copy link
Contributor

@glyuck glyuck commented Apr 9, 2025

mask parameter should be sent as a file (instead of a string).
It can also be nil, so don't throw an assertion error in that case.

`mask` parameter should be file, also it can be nil
@jamesrochabrun
Copy link
Owner

hello thanks for contributing, the PR description is a bit confusing compared to all the code on the PR, what is the bug we are solving with this changes?

@glyuck glyuck force-pushed the fix_image_edit_mask branch from b488eae to 769dcf9 Compare April 15, 2025 07:04
@glyuck
Copy link
Contributor Author

glyuck commented Apr 15, 2025

Sorry – I accidentally added an extra commit to the PR, but it's been removed now.

  • The mask parameter in the images/edits request should be sent as a file (PNG image)
  • This parameter is optional, so we should update the following condition:
        if maskData == nil {
           assertionFailure("Failed to get mask data")
        }
    
    We should also handle the optional .file parameter in MultipartFormDataEntry.

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