Add a new function, 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 an https or http URL, it will attempt to download that image to a temporary file and use that (the old behavior of set_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 🤷🏻.
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 🤷🏻.