feat: new function set_content_image()
, deprecate old set_image_*
functions
#302
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.
Fixes #294
set_image_path(content, path)
,set_image_url(content, url)
,set_image_webshot(content)
.set_content_image(content, path)
. The new function can handle a local file path or a remote URL. If the path points to a local file that exists, it will use that. Otherwise, if it is anhttps
orhttp
URL, it will attempt to download that image to a temporary file and use that (the old behavior ofset_image_url()
.In a future PR to the
connect
repo,set_image_webshot()
will become a recipe in the SDK Cookbook.Note: this wasn't based off the 0.3.0 release, so the NEWS will have a merge conflict once that PR has merged. Not sure why I started it from
main
, but I did 🤷🏻.