Show latest image from folder

Moderator: leecollings

Post Reply
johan99
Posts: 8
Joined: Wednesday 24 August 2016 15:25
Target OS: -
Domoticz version:
Contact:

Show latest image from folder

Post by johan99 »

Hi,
I've got a camera (Vistacam) wich I'm unable to add to domoticz. However, I'm OK with showing fotos from it. But it puts images in a folder and all image files gets different names. Is there a simple way to show the newest image file from a folder? I'd like to add that code to my frontpage.html.

/Johan
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Show latest image from folder

Post by Egregius »

What is the filename structure?
You're ok with php?
johan99
Posts: 8
Joined: Wednesday 24 August 2016 15:25
Target OS: -
Domoticz version:
Contact:

Re: Show latest image from folder

Post by johan99 »

The camera stores jpg-files in a folder:
c:\Domoticz\www\cams\chicken
on a windows server.
the files are named similar to this: VSTA016411UKFLZ_0_20161226085543_5.jpg

I'm new to PHP but it could be a good reason to start learning :D
User avatar
Egregius
Posts: 2592
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Show latest image from folder

Post by Egregius »

The first part is always the same? Then a date/time stamp with a sequential number at the end?
How often do they update?
Maybe I'll write something tomorrow with the php glob function. Can't be to difficult with such names.
stlaha2007
Posts: 370
Joined: Monday 05 October 2015 10:16
Target OS: -
Domoticz version:
Contact:

Re: RE: Re: Show latest image from folder

Post by stlaha2007 »

johan99 wrote:The camera stores jpg-files in a folder:
c:\Domoticz\www\cams\chicken
on a windows server.
the files are named similar to this: VSTA016411UKFLZ_0_20161226085543_5.jpg

I'm new to PHP but it could be a good reason to start learning :D
Why not schedule (previously know as AT) a batchfile (or 2) to copy the latest into say c:\domoticz\www\vesta_image.jpg.

Windows standard is to write date/timestamp with LastModified so u can use that for your Latest Image.

After that you can setup a 'static' camera within Domoticz with the url http://domo-ip:domo-port/vesta_image.jpg

And to clean up say daily another to copy/move the last whole day to c:\image_bak\year\month\day

Basic commands are available for these methods in windows. Or learn PowerShell which you give fine grained control over date/time etc.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest