Allow filtering of the image URL prior to generating image tags and alternate text #217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description of the Change
In instances where an image has been offloaded to a CDN, running the
image
CLI command is failing. This command callsgenerate_image_alt_tags()
, which callsget_largest_acceptable_image_url()
, which requires an image to be physically present on the server. If the image is not present, the image URL is null and no tags or alternate text can be generated.Alternate Designs
None
Benefits
This pull request adds a filter to allow overriding of the image URL which can allow the Computer Vision API to pull the image directly from a CDN.
Possible Drawbacks
None
Verification Process
No verification was performed.
Checklist:
Changelog Entry
classifai_generate_image_alt_tags_source_url
filter to allow overriding of the image URL withingenerate_image_alt_tags()