Dynamic Refreshing Image URL

Plugins that users have built. NOTE: plugins that were developed for Indigo versions older than 2022.1 will have to be updated to work with Indigo 2022.1 (Python 3 - see this blog post for details). If the plugin listed here is not in the Plugin Store (which will show updated plugins) then you will need to ask on the appropriate thread below if it has been updated and where you get get the update.
EagleDTW
Posts: 81
Joined: Thu Apr 30, 2020 5:56 pm

Re: Dynamic Refreshing Image URL

Post by EagleDTW »

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
Last edited by EagleDTW on Thu May 04, 2023 11:14 am, edited 1 time in total.
User avatar
jay (support)
Site Admin
Posts: 18376
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Dynamic Refreshing Image URL

Post by jay (support) »

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.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
Ironshel
Posts: 4
Joined: Tue Dec 17, 2019 2:18 pm

Re: Dynamic Refreshing Image URL

Post by Ironshel »

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 :-)
Betacruxis
Posts: 60
Joined: Sat Apr 03, 2010 6:37 am

Re: Dynamic Refreshing Image URL

Post by Betacruxis »

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.
User avatar
whmoorejr
Posts: 767
Joined: Tue Jan 15, 2013 11:23 am
Location: Houston, TX

Re: Dynamic Refreshing Image URL

Post by whmoorejr »

Betacruxis wrote: Tue Mar 19, 2024 1:49 pm ...used file:// to point to ...
one possible issue...
use three "/".

Code: Select all

file:///
I have a Variable with a URL in it. Sometimes it loads in a webpage, sometimes it doesn't. I've pretty much stuck to using scripts to get images and save them in a folder that I can point to with a control page.

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
Note that a jpg CAN save as a png without issue. This is helpful if you want to use a animated image. My "Loading2.png" was a animated .gif loading symbol that I saved as a PNG file.
Bill
My Plugin: My People
Post Reply

Return to “User Plugins”