Hi @Jay,
It sounds like in 2022.2.2 that this functionality of dynamic refreshing image url feature has been deprecated...what is the best method to adjust to having images gathered from a camera and displayed in a rotating variables with paths to the image files' url?
Thank you,
Daniel
Dynamic Refreshing Image URL
Re: Dynamic Refreshing Image URL
Last edited by EagleDTW on Thu May 04, 2023 11:14 am, edited 1 time in total.
- jay (support)
- Site Admin
- Posts: 18376
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
Re: Dynamic Refreshing Image URL
As I say above, you can use a file:/// url that points to an image file on your drive that you update via a script.
I've added a feature request to add the ability to get a URL from a variable for some future release.
I've added a feature request to add the ability to get a URL from a variable for some future release.
Re: Dynamic Refreshing Image URL
Don't know where this stands today. I just upgraded to 2022.2.2 only to discover this problem which broke several of my control pages.
One point I wanted to add was that I have several pages where I use this function to show an image dynamically. In my case, this means that I show a picture from my Doorbird (in one example) as an overlay to my control page when someone hits the doorbell. The image from Doorbird is a .jpg. After buzzing them in, I want to make the picture disappear. Since .jpg images don't have a transparency layer, I need to replace the image with a .png file when I want to make it "disappear". Without the dynamic URL function, this is very difficult to achieve. The file:/// has to point to a .jpg file or a .png file but I had been swapping them out with indirection through a variable. I can't get a png from Doorbird and I can't make a transparent .jpg.
Hoping the dynamic URL comes back soon
One point I wanted to add was that I have several pages where I use this function to show an image dynamically. In my case, this means that I show a picture from my Doorbird (in one example) as an overlay to my control page when someone hits the doorbell. The image from Doorbird is a .jpg. After buzzing them in, I want to make the picture disappear. Since .jpg images don't have a transparency layer, I need to replace the image with a .png file when I want to make it "disappear". Without the dynamic URL function, this is very difficult to achieve. The file:/// has to point to a .jpg file or a .png file but I had been swapping them out with indirection through a variable. I can't get a png from Doorbird and I can't make a transparent .jpg.
Hoping the dynamic URL comes back soon
-
- Posts: 60
- Joined: Sat Apr 03, 2010 6:37 am
Re: Dynamic Refreshing Image URL
Since the Dynamic Refreshing Image URL is not working anymore, I took your advice to used file:// to point to downloaded images to display in control pages.
But no matter which method or library I use in the script that downloads the images, after a while I start to get the "403 Forbidden" error.
Even using plug-ins to download the images (such as "Image Downloader & SecuritySpy..."), I get same error after a few days of using them.
Nonetheless, Indigo is till capable of refreshing those images if I put the direct URL into the control page image control, at least until the URL is no longer valid, of course.
So my question is which method is Indigo using to refresh those images from the web? Can it be replicated into a script?
Thanks.
But no matter which method or library I use in the script that downloads the images, after a while I start to get the "403 Forbidden" error.
Even using plug-ins to download the images (such as "Image Downloader & SecuritySpy..."), I get same error after a few days of using them.
Nonetheless, Indigo is till capable of refreshing those images if I put the direct URL into the control page image control, at least until the URL is no longer valid, of course.
So my question is which method is Indigo using to refresh those images from the web? Can it be replicated into a script?
Thanks.
Re: Dynamic Refreshing Image URL
one possible issue...
use three "/".
Code: Select all
file:///
For getting an image, you can use something like this:
Code: Select all
import requests
from shutil import copyfile
THIS_SCRIPT = 'Get my URL Image {}'
IMAGE_PATH = '/Users/williammoore/Desktop/StaticRotate/MyImage.png'
imageLoadingPath = '/Users/williammoore/Desktop/StaticRotate/Loading2.png'
IMAGE_URL = 'https://upload.wikimedia.org/wikipedia/commons/d/de/Bananavarieties.jpg'
try:
reply = requests.get(IMAGE_URL)
reply.raise_for_status()
except:
copyfile(imageLoadingPath, IMAGE_PATH) #optional to put a static image in the location.
indigo.server.log(
THIS_SCRIPT.format('No URL image available'),
isError=True
)
else:
# Save the content to a file
with open(IMAGE_PATH, 'wb') as image_file:
image_file.write(reply.content)
indigo.server.log(
THIS_SCRIPT.format('Successfull Run'))
# Control page, use file:///Users/williammoore/Desktop/StaticRotate/MyImage.png
Bill
My Plugin: My People
My Plugin: My People