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

fix images validation in _parse_image method #81

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

Conversation

heisenbergye
Copy link
Contributor

Issue #, if available:

Description of changes:

  1. validate images type is base64 or url
  2. check if image format is bedrock supported
  3. check if image could be accessed, and content-type is valid

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

if response.status_code == 200:
def _parse_image(self, image_url: str) -> tuple[bytes, str]:

if "base64" in image_url:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you improve this check for the edge case like https://example.com/path/base64.jpg?

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